MeleeWeaponEnchantment
Extends Enchantment
Classes extending this class can be applied to weapons and activate when used by a mob to attack another mob in melee combat.
Methods
getDamageBonus()
php
abstract public function getDamageBonus(int $enchantmentLevel) : floatReturns the amount of additional damage caused by this enchantment to applicable targets.
isApplicableTo()
php
abstract public function isApplicableTo(\pocketmine\entity\Entity $victim) : boolReturns whether this melee enchantment has an effect on the target entity. For example, Smite only applies to undead mobs.
onPostAttack()
php
public function onPostAttack(\pocketmine\entity\Entity $attacker, \pocketmine\entity\Entity $victim, int $enchantmentLevel) : voidCalled after damaging the entity to apply any post damage effects to the target.
