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.

Featured Replies

Posted

Is their a way i can make an item that gets damaged in crafting get repaired via crafting?

Legend of Zelda Mod[updated September 20th to 3.1.1]

Extra Achievements(Minecraft 1.8!)[updated April 3rd to 2.3.0]

Fancy Cheeses[updated May 8th to 0.5.0]

  • Author

...Um, yes. Use a damaged ItemStack as the output.

That just clones the item.

Legend of Zelda Mod[updated September 20th to 3.1.1]

Extra Achievements(Minecraft 1.8!)[updated April 3rd to 2.3.0]

Fancy Cheeses[updated May 8th to 0.5.0]

  • Author

As in, set the damage (metadata) to 0.

1.this would still clone it

2.i don't want it to be 100%, if i did i would use the anvil

Legend of Zelda Mod[updated September 20th to 3.1.1]

Extra Achievements(Minecraft 1.8!)[updated April 3rd to 2.3.0]

Fancy Cheeses[updated May 8th to 0.5.0]

As in, set the damage (metadata) to 0.

1.this would still clone it

2.i don't want it to be 100%, if i did i would use the anvil

Aw, for the love of Pete. Just show me your code.

BEWARE OF GOD

---

Co-author of Pentachoron Labs' SBFP Tech.

  • Author

As in, set the damage (metadata) to 0.

1.this would still clone it

2.i don't want it to be 100%, if i did i would use the anvil

Aw, for the love of Pete. Just show me your code.

Maybe I didn't explain well enough:

I have an item. When you use it in a crafting recipe it remains and simply takes damage(Like the minium stone from EE3).

I want the item to have a recipe that repairs the item instead of damaging it.

Legend of Zelda Mod[updated September 20th to 3.1.1]

Extra Achievements(Minecraft 1.8!)[updated April 3rd to 2.3.0]

Fancy Cheeses[updated May 8th to 0.5.0]

Oh, that kind of item. *facepalm* If you'd said "RP2 chisel", I'd have known exactly what you meant.

ย 

So it looks like you'll have to define a custom class that inherits IRecipe.

BEWARE OF GOD

---

Co-author of Pentachoron Labs' SBFP Tech.

  • Author

What do i do within the class?

ย 

(also here is my crafting manager if i can just use this file)

package dudesmods.lozmod;

import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.IInventory;
import net.minecraft.item.ItemStack;
import cpw.mods.fml.common.ICraftingHandler;

public class LOZCraftingHandler implements ICraftingHandler {

 public void onCrafting(EntityPlayer player, ItemStack item, IInventory inv) 
 {
ย  ย  for(int i=0; i < inv.getSizeInventory(); i++)
ย  {ย  ย  ย  ย   
ย  ย  ย  if(inv.getStackInSlot(i) != null)
ย  ย  ย  {
ย  ย  ย   ItemStack j = inv.getStackInSlot(i);
ย  ย  ย   if(j.getItem() != null && j.getItem() == LOZmod.magicPowder)
ย  ย  ย   {
ย  ย  ย  ย  ItemStack k = new ItemStack(LOZmod.magicPowder, 2, (j.getItemDamage() + 1));
ย  ย  ย  ย  inv.setInventorySlotContents(i, k);
ย  ย  ย   }
ย  ย  ย  }ย  
ย  }
 }

@Override
public void onSmelting(EntityPlayer player, ItemStack item) {
	// TODO Auto-generated method stub

}
}

Legend of Zelda Mod[updated September 20th to 3.1.1]

Extra Achievements(Minecraft 1.8!)[updated April 3rd to 2.3.0]

Fancy Cheeses[updated May 8th to 0.5.0]

What do i do within the class?

ย 

(also here is my crafting manager if i can just use this file)

package dudesmods.lozmod;

import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.IInventory;
import net.minecraft.item.ItemStack;
import cpw.mods.fml.common.ICraftingHandler;

public class LOZCraftingHandler implements ICraftingHandler {

 public void onCrafting(EntityPlayer player, ItemStack item, IInventory inv) 
 {
ย  ย  for(int i=0; i < inv.getSizeInventory(); i++)
ย  {ย  ย  ย  ย   
ย  ย  ย  if(inv.getStackInSlot(i) != null)
ย  ย  ย  {
ย  ย  ย   ItemStack j = inv.getStackInSlot(i);
ย  ย  ย   if(j.getItem() != null && j.getItem() == LOZmod.magicPowder)
ย  ย  ย   {
ย  ย  ย  ย  ItemStack k = new ItemStack(LOZmod.magicPowder, 2, (j.getItemDamage() + 1));
ย  ย  ย  ย  inv.setInventorySlotContents(i, k);
ย  ย  ย   }
ย  ย  ย  }ย  
ย  }
 }

@Override
public void onSmelting(EntityPlayer player, ItemStack item) {
	// TODO Auto-generated method stub

}
}

Oh, that looks like it should work. Although I would just use j.setItemDamage(j.getItemDamage()+1) instead of creating a new ItemStack.

BEWARE OF GOD

---

Co-author of Pentachoron Labs' SBFP Tech.

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

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.