Jump to content

CamHex

Members
  • Posts

    4
  • Joined

  • Last visited

1 Follower

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

CamHex's Achievements

Tree Puncher

Tree Puncher (2/8)

0

Reputation

  1. Yes, of course, those codes are just for testing.
  2. Thanks! It works fine: @Mod("testmod") public final class TestMod { public TestMod() { FMLJavaModLoadingContext.get().getModEventBus().addGenericListener( GlobalLootModifierSerializer.class, (RegistryEvent.Register event) -> { TestLootItemFunctions.init(); } ); } }
  3. Thanks. So is there any plan to support register additional registry entry (such as LootItemFunctionType) in the future?
  4. Hello, I want to register additional LootItemFunction(LootItemFunctionType), LootItemConditions(LootItemConditionType) and etc, At 1.18.1, I was using the following code, it works fine: @Mod("testmod") public final class TestMod { public TestMod() { TestLootItemFunctions.init(); } } public final class TestLootItemFunctions { public static void init() {} public static final LootItemFunctionType TEST_FUNCTION = register(new ResourceLocation("testmod:test"), new TestFunction.Serializer()); private static LootItemFunctionType register(ResourceLocation id, Serializer<? extends LootItemFunction> serializer) { // net.minecraft.core.Registry return Registry.register(Registry.LOOT_FUNCTION_TYPE, id, new LootItemFunctionType(serializer)); } } But it is no longer works (Minecraft 1.18.2, official mappings, Forge 40.0.3): Caused by: java.lang.IllegalStateException: Registry is already frozen (trying to add key ResourceKey[minecraft:loot_function_type / testmod:test]) at net.minecraft.core.MappedRegistry.validateWrite(MappedRegistry.java:78) ~[forge-1.18.2-40.0.3_mapped_official_1.18.2-recomp.jar%2376!/:?] at net.minecraft.core.MappedRegistry.registerMapping(MappedRegistry.java:87) ~[forge-1.18.2-40.0.3_mapped_official_1.18.2-recomp.jar%2376!/:?] at net.minecraft.core.MappedRegistry.registerMapping(MappedRegistry.java:83) ~[forge-1.18.2-40.0.3_mapped_official_1.18.2-recomp.jar%2376!/:?] at net.minecraft.core.MappedRegistry.register(MappedRegistry.java:128) ~[forge-1.18.2-40.0.3_mapped_official_1.18.2-recomp.jar%2376!/:?] at net.minecraft.core.Registry.register(Registry.java:564) ~[forge-1.18.2-40.0.3_mapped_official_1.18.2-recomp.jar%2376!/:?] at net.minecraft.core.Registry.register(Registry.java:560) ~[forge-1.18.2-40.0.3_mapped_official_1.18.2-recomp.jar%2376!/:?] at com.testmod.server.loot.TestLootItemConditions.register(TestLootItemConditions.java:17) ~[%2380!/:?] at com.testmod.server.loot.TestLootItemConditions.<clinit>(TestLootItemConditions.java:14) ~[%2380!/:?] at com.testmod.TestMod.<init>(TestMod.java:23) ~[%2380!/:?] ... 14 more
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.