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.

Necrolytie

Members
  • Joined

  • Last visited

  1. Sorry, forgeted this part. The register: :myitem= new Item().setUnlocalizedName("myitem").setCreativeTab(MyCreativeTab).setTextureName(Strings.MODID + ":" + "myitem").setMaxStackSize(1).setMaxDamage(25).setNoRepair(); GameRegistry.registerItem(ironhammer, "myitem");
  2. Hi everyone! This is my first post, so go easy on me, also i'd like to apologise in advance about my english, that not that good but i'm sure you all will understand. I'm a beginner em "progamming" ( the quotes are cuz i'm not that good ), so, of course before i decide to make this post, i searched into the deeps of the internet for the answer but i don't even get close what i did wrong. I was doing a easy task, this worked, but with a bug, the item last forever! The item takes damage, but when it goes to 0(zero) this wont break, it still taking damage over damage but still there. This is the event code: package com.electroink.main; import net.minecraft.block.Block; import net.minecraft.item.ItemStack; import net.minecraft.potion.Potion; import net.minecraft.potion.PotionEffect; import cpw.mods.fml.common.eventhandler.SubscribeEvent; import cpw.mods.fml.common.gameevent.PlayerEvent; public class MyMod { @SubscribeEvent public void onCrafting(PlayerEvent.ItemCraftedEvent e) { for(int i=0; i < e.craftMatrix.getSizeInventory(); i++) { if(e.craftMatrix.getStackInSlot(i) != null) { ItemStack j = e.craftMatrix.getStackInSlot(i); if(j.getItem() != null && j.getItem() == DamagedItem) { ItemStack k = new ItemStack(DamagedItem, 2, (j.getItemDamage() + 1 )); e.craftMatrix.setInventorySlotContents(i, k); } } } } } The FML stuff: @EventHandler public static void PreLoad(FMLPreInitializationEvent PreEvent){ FMLCommonHandler.instance().bus().register(new MyMod()); } And the recipe: GameRegistry.addShapelessRecipe(new ItemStack(crafteditem, 1, 0), new ItemStack(useditem1), new ItemStack(willgetdamageitem, 1, OreDictionary.WILDCARD_VALUE)); I'd like to thanks the attention. Best regrats, Necrolytie.

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.