Jump to content

CodyRupp

Members
  • Posts

    2
  • Joined

  • Last visited

CodyRupp's Achievements

Tree Puncher

Tree Puncher (2/8)

0

Reputation

  1. I'm making an all-in-one tool, so I figured it would be best to extend DiggerItem and then implement the functionality of each integrated tool in my item's class.
  2. Hi, I created a custom tool that extends the DiggerItem class, but I am unable to give it enchantments as with other tools. For example, when I try to use the /enchant command, it says that my item "cannot support that enchantment". Similarly, the anvil does not allow me to add book enchantments to the item. I have tried overwriting the methods relating to enchantments, as shown below. What are the steps that I need to take to enable vanilla enchantments on my custom tool? Current code: public class MyItem extends DiggerItem { public MyItem(Tier tier, Properties pProperties) { super(tier, MyTags.Blocks.MINEABLE_WITH_MYITEM, pProperties); } @Override public boolean canPerformAction(ItemStack stack, ToolAction toolAction) { return true; } @Override public boolean canApplyAtEnchantingTable(ItemStack stack, Enchantment enchantment) { return true; } @Override public boolean isBookEnchantable(ItemStack stack, ItemStack book) { return true; } @Override public boolean isEnchantable(@SuppressWarnings("null") ItemStack pStack) { return true; } }
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.