Posted July 12, 20196 yr Hello there. I was trying to work on some custom tools, for starters a pickaxe, and i stumbled upon a... strange issue. Hovering over it in my inventory shows a Attack Value of 76, and a Use Speed of 4. Here's the code i'm using currently:ModToolPickaxe.java Spoiler package ahndreklicyri.bsm.items; import net.minecraft.item.IItemTier; import net.minecraft.item.ItemGroup; import net.minecraft.item.PickaxeItem; public class ModToolPickaxe extends PickaxeItem { public ModToolPickaxe(String Name, IItemTier Tier,ItemGroup Group){ super(Tier, Tier.getMaxUses(), 0, new Properties().group(Group)); this.setRegistryName("bsm",Name); } } ItemStore.java Spoiler Setting up the Tier public static IItemTier CopperTier = new IItemTier() { @Override public int getMaxUses() { return 75; } @Override public float getEfficiency() { return 5; } @Override public float getAttackDamage() { return 0; } @Override public int getHarvestLevel() { return 1; } @Override public int getEnchantability() { return 0; } @Override public Ingredient getRepairMaterial() { return null; } }; Creating the Item //Tab is just my custom creative tab public static ModToolPickaxe c_pickaxe = new ModToolPickaxe("copper_pickaxe",CopperTier,Tab); Some help figuring out why it has a attack value of 76 would be nice, also how to set up the getRepairMaterial() part as well. Unrelated issue, when held in the hand, it renders as normal item (see attached screenshot). In the Model JSON, is there a "item/pickaxe" or something? Edited July 12, 20196 yr by Ahndrek Li'Cyri Issue solved, Updated Title
July 12, 20196 yr 26 minutes ago, Ahndrek Li'Cyri said: In the Model JSON, is there a "item/pickaxe" or something? If you change the parent it should be fixed. "parent": "item/handheld", 26 minutes ago, Ahndrek Li'Cyri said: Hovering over it in my inventory shows a Attack Value of 76, and a Use Speed of 4. You have set the attack value to maximum usage and the default attack speed of a diamond pickaxe is -2.8F i guess. super(Tier, Tier.getMaxUses(), 0, new Properties().group(Group)); protected PickaxeItem(IItemTier tier, int attackDamageIn, float attackSpeedIn, Item.Properties builder){...} I also would recommend you to create a toolmaterial enum which implements IItemTier for custom tool materials. Edited July 12, 20196 yr by Skyriis
July 12, 20196 yr Author 1 hour ago, Skyriis said: If you change the parent it should be fixed. "parent": "item/handheld", You have set the attack value to maximum usage and the default attack speed of a diamond pickaxe is -2.8F i guess. super(Tier, Tier.getMaxUses(), 0, new Properties().group(Group)); protected PickaxeItem(IItemTier tier, int attackDamageIn, float attackSpeedIn, Item.Properties builder){...} I also would recommend you to create a toolmaterial enum which implements IItemTier for custom tool materials. That fixed it, thanks! I couldn't accurately see what each field was because InteliJ was only showing each as "p_xXXXXXX_X_" instead of the correct names. Anyways, thanks for the help!
July 12, 20196 yr Author Ah thanks, that also fixed that issue. Can't believe i forgot to do that. Heh.
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.