Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

CamHex

Members
  • Joined

  • Last visited

Everything posted by CamHex

  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

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.