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;
}
}