Add custom enchantment for tracking landmines

This commit is contained in:
Gabriel Tofvesson 2021-09-15 23:14:10 +02:00
parent 015e76eb50
commit e42e97a8c4

View File

@ -0,0 +1,17 @@
package dev.w1zzrd.spigot.landmines2
import org.bukkit.NamespacedKey
import org.bukkit.enchantments.Enchantment
import org.bukkit.enchantments.EnchantmentTarget
import org.bukkit.inventory.ItemStack
class LandmineEnchantment(key: NamespacedKey): Enchantment(key) {
override fun getName() = "Landmine"
override fun getMaxLevel() = 1
override fun getStartLevel() = 1
override fun getItemTarget() = EnchantmentTarget.TOOL
override fun isTreasure() = false
override fun isCursed() = true
override fun conflictsWith(other: Enchantment) = true
override fun canEnchantItem(item: ItemStack) = false
}