parkat Posted October 18, 2021 Posted October 18, 2021 (edited) 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, 2021 by parkat Quote
izofar Posted October 18, 2021 Posted October 18, 2021 ItemGroup belongs to the net.minecraft.item package, not "items" Quote
parkat Posted October 18, 2021 Author Posted October 18, 2021 1 hour ago, izofar said: ItemGroup belongs to the net.minecraft.item package, not "items" that doesn't work either Quote
Luis_ST Posted October 19, 2021 Posted October 19, 2021 (edited) 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, 2021 by Luis_ST Quote
parkat Posted October 19, 2021 Author Posted October 19, 2021 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!! Quote
Recommended Posts
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.