My crafting recipe with a custom item that has durability does not work when it loses durability.
public class ItemHammer extends Item {
public ItemHammer(String name)
{
setUnlocalizedName(name);
setRegistryName(name);
setCreativeTab(Main.productioncrafttoolstab);
setNoRepair();
setMaxDamage(79);
setMaxStackSize(1);
ModItems.ITEMS.add(this);
}
@Override
public boolean hasContainerItem(ItemStack stack)
{
return true;
}
@Override
public ItemStack getContainerItem(ItemStack itemStack)
{
return itemStack.getItemDamage() < itemStack.getMaxDamage() ? new ItemStack(itemStack.getItem(), 1, itemStack.getItemDamage() + 1) : ItemStack.EMPTY;
}
}
{
"type": "minecraft:crafting_shapeless",
"ingredients":
[
{
"item": "productioncraft:copper_ingot"
},
{
"item": "productioncraft:hammer"
}
],
"result":
{
"item": "productioncraft:copper_plate",
"count": 1
}
}
I have tried adding “data”: “32,767” but that makes my damaged item and completely new item (with no durability damage) not work
All help is appreciated