Posted October 18, 20214 yr I am new to modding and I'm sure this is a simple fix but I cannot for the life of me figure out why this error is thrown. I am running forge-1.17.1-37.0.90 and all other aspects seem to be working fine I am following this tutorial https://thebookofmodding.ml/adding-custom-items/ here is my code (sorry its messy rn) [registryhandler class] https://imgur.com/a/EGC2jyj package com.example.examplemod; import net.minecraft.item.ItemGroup; import net.minecraft.world.item.Item; import net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext; import net.minecraftforge.fmllegacy.RegistryObject; import net.minecraftforge.registries.DeferredRegister; import net.minecraftforge.registries.ForgeRegistries; /* public class RegistryHandler { // create DeferredRegister object public static final DeferredRegister<Item> ITEMS = DeferredRegister.create(ForgeRegistries.ITEMS, ExampleMod.MODID); public static void init() { // attach DeferredRegister to the event bus ITEMS.register(FMLJavaModLoadingContext.get().getModEventBus()); } // register item public static final RegistryObject<Item> COPPER = ITEMS.register("copper", () -> // new Item(new Item.Properties().group(ItemGroup.MATERIALS)) // ); new Item( new Item.Properties().group(ItemGroup.MATERIALS) ) ); */ public class RegistryHandler { public static final DeferredRegister<Item> ITEMS = DeferredRegister.create(ForgeRegistries.ITEMS, ExampleMod.MODID); public static void init() { // attach DeferredRegister to the event bus ITEMS.register(FMLJavaModLoadingContext.get().getModEventBus()); } public static final RegistryObject<Item> TITAN = ITEMS.register("titan", ()-> new Item(new Item.Properties().group(ItemGroup.REDSTONE))); } Edited October 18, 20214 yr by parkat
October 18, 20214 yr Author 1 hour ago, izofar said: ItemGroup belongs to the net.minecraft.item package, not "items" that doesn't work either
October 19, 20214 yr Forge use now Mojang class names and their package names, you can use the Forge bot on discord to convert from mcp to moj mappings But I would recommend you to use this scrip it will update your hole project automatically Edited October 19, 20214 yr by Luis_ST
October 19, 20214 yr Author 12 hours ago, Luis_ST said: Forge use now Mojang class names and their package names, you can use the Forge bot on discord to convert from mcp to moj mappings But I would recommend you to use this scrip it will update your hole project automatically thank you! this works!!
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.