Jump to content

1.12.2 'Item()' in 'net.minecraft.item.Item' cannot be applied to '(net.minecraft.item.Item)'


Raywilleatchu

Recommended Posts

I know 1.12.2 is old school modding now (isn't weird but feels weird)

I'm literally just looking to learn to make an item and the commented out examples in Intellij's Minecraft Development plugin are actual garbage.

I copied the exact process shown in their examples and when I go register the item it gives me the error 'Item()' in 'net.minecraft.item.Item' cannot be applied to '(net.minecraft.item.Item)'

    @GameRegistry.ObjectHolder(MOD_ID)
    public static class Items
    {
        public static final Item test = null;
          //public static final Item test = null;
          //public static final ItemBlock mySpecialBlock = null; // itemblock for the block above
          //public static final MySpecialItem mySpecialItem = null; // placeholder for special item below

    }

    /**
     * This is a special class that listens to registry events, to allow creation of mod blocks and items at the proper time.
     */
    @Mod.EventBusSubscriber
    public static class ObjectRegistryHandler {
        /**
         * Listen for the register event for creating custom items
         */

        @SubscribeEvent
        public static void addItems(RegistryEvent.Register<Item> event)
        {
            //event.getRegistry().register(new ItemBlock(Blocks.myBlock).setRegistryName(MOD_ID, "myBlock"));
             //event.getRegistry().register(new MySpecialItem().setRegistryName(MOD_ID, "mySpecialItem"));
            event.getRegistry().register(new Item(Items.test).setRegistryName(MOD_ID, "test"));

        }

The error I am receiving is inside the addItems() method. It underlines the (Items.test).

I have already looked inside the 1.12.2 docs when it comes to adding an item and setting up the item registry. It doesn't tell me much about the syntax when registering an item.

 

If someone could help it would be much appreciated.

Link to comment
Share on other sites

  • Guest locked this topic
Guest
This topic is now closed to further replies.

Announcements



×
×
  • Create New...

Important Information

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