Posted October 3, 20177 yr Hello, I am very new to modding with forge. I was reading many different tutorials and they describe really dífferently. Some codes are not working and some are and its not same However. I try to understand the documentation of forge but its really hard. Anyways. I finally have my item in minecraft. It is working like a Iron PickAxe. Only the rendering do problems. I see this So I think I missing something but what. So how my eclipse looks package mazmod.hammertoolmod.item.tools; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.item.ItemPickaxe; public class ItemSuperPickAxe extends ItemPickaxe { public ItemSuperPickAxe(ToolMaterial material, final String itemName) { super(material); // TODO Auto-generated constructor stub setUnlocalizedName(itemName); setRegistryName(itemName); setCreativeTab(CreativeTabs.DECORATIONS); } @Override public ItemSuperPickAxe setCreativeTab(CreativeTabs tab) { super.setCreativeTab(tab); return this; } } package mazmod.hammertoolmod; import java.util.ArrayList; import java.util.List; import net.minecraft.item.Item; import net.minecraftforge.event.RegistryEvent; import net.minecraftforge.fml.common.Mod; import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; import net.minecraftforge.registries.IForgeRegistry; @Mod.EventBusSubscriber(modid = TutorialMod.MODID) public class RegisterHandler { static List<Item> items = new ArrayList<Item>(); public static void AddRegisterItemQueue(Item item) { items.add(item); } @SubscribeEvent protected static void registerItems(final RegistryEvent.Register<Item> event) { IForgeRegistry<Item> reg = event.getRegistry(); for (int i = 0; i < items.size(); i++) { reg.register(items.get(i)); } } } This above was even hard. registerItems itself do not call if EventBusSubscriber is not defined above class. There is more like NewRegistry but I didn't understand it. package mazmod.hammertoolmod; import mazmod.hammertoolmod.item.tools.ItemSuperPickAxe; import net.minecraft.item.Item.ToolMaterial; import net.minecraftforge.fml.common.Mod; import net.minecraftforge.fml.common.Mod.EventHandler; import net.minecraftforge.fml.common.event.FMLInitializationEvent; import net.minecraftforge.fml.common.event.FMLPostInitializationEvent; import net.minecraftforge.fml.common.event.FMLPreInitializationEvent; @Mod(modid = TutorialMod.MODID, version = TutorialMod.VERSION, name = TutorialMod.NAME) public class TutorialMod { public static final String MODID = "tut"; public static final String NAME = "tutorialmod"; public static final String VERSION = "0.1"; @Mod.Instance(TutorialMod.MODID) public static TutorialMod instance; @EventHandler public void preInit(FMLPreInitializationEvent event){ RegisterHandler.AddRegisterItemQueue(new ItemSuperPickAxe(ToolMaterial.IRON, "superPickAxe")); } @EventHandler public void init(FMLInitializationEvent event){ } @EventHandler public void postInit(FMLPostInitializationEvent event){ } } Another question. After I learned it little bit I want to make a Hammer which can be used for every type of blocks. How could I do it. I mean if I use example For digging it should be strong like shovel. If I use it for blocks like stone, iron ore etc it should be like pickaxe. Edited October 3, 20177 yr by MaZy Title has more sense now.
October 3, 20177 yr You aren't telling the game about the model. You need to call ModelLoader.setCustomModelResourceLocation during the ModelRegistryEvent event. Also, stop using builtin/generated as your model's parent. item/generated and item/handheld both exist and means you don't need to supply display tags. Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable. If you think this is the case, JUST REPORT ME. Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice. Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked. DO NOT PM ME WITH PROBLEMS. No help will be given.
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.