Closed Boy0000 closed 3 years ago
Do I need to also implement the system for ignoring armor, or just make the bool that basically does nothing
Do I need to also implement the system for ignoring armor, or just make the bool that basically does nothing
Also implement it. For a simple way to do this, just calling the bukkit Entity.damage()
function takes armor into account. The code thats written there right now sets the HP directly, essentially ignoring armor.
I'm trying to implement the logic, but IntelliJ keeps giving me inferred type is Unit but Double was expected
at bukkit.damage()
val bukkit = entity.toBukkit<LivingEntity>() ?: return false
val ignoreArmor = false
bukkit.health = if (ignoreArmor) (bukkit.health - damage.randomOrMin()).coerceAtLeast(minHealth) else bukkit.damage(damage.randomOrMin());
return true
bukkit.damage()
doesn't return a health value, its a void function that deals damage to the target
If anyone wants to implement this, call it
ignoreArmor
and default to false