![JAR search and dependency download from the Maven repository](/logo.png)
cn.nukkit.item.enchantment.EnchantmentVanishingCurse Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of powernukkit Show documentation
Show all versions of powernukkit Show documentation
A Minecraft Bedrock Edition server software implementation made in Java from scratch which supports all new features.
package cn.nukkit.item.enchantment;
import cn.nukkit.block.BlockID;
import cn.nukkit.item.Item;
import cn.nukkit.item.ItemID;
public class EnchantmentVanishingCurse extends Enchantment {
protected EnchantmentVanishingCurse() {
super(ID_VANISHING_CURSE, "curse.vanishing", Rarity.VERY_RARE, EnchantmentType.BREAKABLE);
}
@Override
public int getMinEnchantAbility(int level) {
return 25;
}
@Override
public int getMaxEnchantAbility(int level) {
return 50;
}
@Override
public boolean canEnchant(Item item) {
switch (item.getId()) {
case ItemID.SKULL:
case ItemID.COMPASS:
return true;
default:
if (item.getId() < 255 && item.getBlock() != null && item.getBlock().getId() == BlockID.CARVED_PUMPKIN) {
return true;
}
return super.canEnchant(item);
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy