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.

tydeFriz

Members
  • Joined

  • Last visited

  1. yes, very much that. thx a lot.
  2. hello again, i have used the DeferredRegister but the same thing happens. i have quite literally copypasted the example in the comment: @Mod(JSONCraft.MODID) public class JSONCraft { public static final String MODID = "jsoncraft"; public static final DeferredRegister<Block> BLOCKS = new DeferredRegister<Block>(ForgeRegistries.BLOCKS, MODID); public static final DeferredRegister<Item> ITEMS = new DeferredRegister<Item>(ForgeRegistries.ITEMS, MODID); public static final RegistryObject<Block> EXAMPLE_BLOCK = BLOCKS.register("example_block", () -> new Block(Block.Properties.create(Material.ROCK))); public static final RegistryObject<Item> ROCK_ITEM = ITEMS.register("example_block", () -> new BlockItem(EXAMPLE_BLOCK.get(), new Item.Properties().group(ModItemGroups.MOD_ITEM_GROUP))); public JSONCraft() { ITEMS.register(FMLJavaModLoadingContext.get().getModEventBus()); BLOCKS.register(FMLJavaModLoadingContext.get().getModEventBus()); trace: [13apr2020 13:02:49.166] [modloading-worker-2/INFO] [net.minecraftforge.common.MinecraftForge/FORGE]: MinecraftForge v31.1.19 Initialized [13apr2020 13:02:49.552] [Render thread/ERROR] [net.minecraftforge.fml.javafmlmod.FMLModContainer/]: Exception caught during firing event: ROCK Index: 2 Listeners: 0: NORMAL 1: net.minecraftforge.eventbus.EventBus$$Lambda$2081/1783933562@3d5f08d4 2: net.minecraftforge.eventbus.EventBus$$Lambda$2081/1783933562@3afaa39f java.lang.NoSuchFieldError: ROCK at network.eden.jsoncraft.JSONCraft.lambda$static$0(JSONCraft.java:36) at network.eden.jsoncraft.JSONCraft$$Lambda$2220/581639050.get(Unknown Source) at net.minecraftforge.registries.DeferredRegister.lambda$register$0(DeferredRegister.java:84) at net.minecraftforge.registries.DeferredRegister$$Lambda$2222/1711574174.get(Unknown Source) at net.minecraftforge.registries.DeferredRegister.addEntries(DeferredRegister.java:117) at net.minecraftforge.registries.DeferredRegister$$Lambda$2251/659577981.accept(Unknown Source) looks like "nearly foolproof" is not enough for me
  3. thanks, mind explaining why? i will, tyvm
  4. tydeFriz joined the community
  5. heya, i cannot get a single block registered. here's what i do: @Mod.EventBusSubscriber(modid = JSONCraft.MODID, bus = Mod.EventBusSubscriber.Bus.MOD) public class ModEventSubscriber { @SubscribeEvent public static void onRegisterBlocks(final RegistryEvent.Register<Block> event) { final IForgeRegistry<Block> registry = event.getRegistry(); for(Block block: ModBlocks.getAll()){ registry.register(block); } } the getAll() method is quite simple atm: import net.minecraft.block.Block; import net.minecraft.block.material.Material; public static final Block A_BLOCK = new Block(Block.Properties.create(Material.ROCK).hardnessAndResistance(3.0F, 3.0F)); public static List<Block> getAll(){ List<Block> list = new ArrayList<>(); list.add(A_BLOCK); return list; } and here's what happens: [13apr2020 11:25:59.045] [Render thread/ERROR] [net.minecraftforge.fml.javafmlmod.FMLModContainer/]: Exception caught during firing event: ROCK Index: 2 Listeners: 0: NORMAL 1: ASM: class network.eden.jsoncraft.ModEventSubscriber onRegisterItems(Lnet/minecraftforge/event/RegistryEvent$Register;)V 2: ASM: class network.eden.jsoncraft.ModEventSubscriber onRegisterBlocks(Lnet/minecraftforge/event/RegistryEvent$Register;)V java.lang.NoSuchFieldError: ROCK at network.eden.jsoncraft.init.ModBlocks.<clinit>(ModBlocks.java:11) at network.eden.jsoncraft.ModEventSubscriber.onRegisterBlocks(ModEventSubscriber.java:20) at net.minecraftforge.eventbus.ASMEventHandler_2_ModEventSubscriber_onRegisterBlocks_Register.invoke(.dynamic) can anybody tell me what am i doing wrong? thx for your time.

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.