I cannot find the answer anywhere
public static void onPlayerConsumeXp(PlayerXpEvent.PickupXp event){
if(event.getEntity().getMainHandItem().getAllEnchantments().get(*value i need*) != null){
int shorthand = event.getEntity().getMainHandItem().getAllEnchantments().get(*value i need*);
I am trying to get my custom enchant inside that *value i need*, I have tried using strings and Enchantments. does not show my enchantment.
This is my enchantment class
package net.test.tutorialmod.enchants;
import net.minecraft.world.entity.EquipmentSlot;
import net.minecraft.world.item.enchantment.Enchantment;
import net.minecraft.world.item.enchantment.EnchantmentCategory;
public class clever extends Enchantment {
public clever(Rarity pRarity, EnchantmentCategory pCategory, EquipmentSlot... pApplicableSlots) {
super(pRarity, pCategory, pApplicableSlots);
}
@Override
public int getMaxLevel() {
return 10;
}
@Override
public int getMinLevel() {
return 1;
}
}
What am i doing wrong?