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.

MaZy

Members
  • Joined

  • Last visited

Everything posted by MaZy

  1. 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.

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.