ProtectionEnchantment
Extends Enchantment
Properties
$applicableDamageTypes protected
php
protected ?array $applicableDamageTypes$typeModifier protected
php
protected float $typeModifierMethods
__construct()
php
public function __construct(\pocketmine\lang\Translatable|string $name, int $rarity, int $primaryItemFlags, int $secondaryItemFlags, int $maxLevel, float $typeModifier, ?array $applicableDamageTypes, ?\Closure $minEnchantingPower = null, int $enchantingPowerRange = 50)ProtectionEnchantment constructor.
getProtectionFactor()
php
public function getProtectionFactor(int $level) : intReturns the base EPF this enchantment type offers for the given enchantment level.
getTypeModifier()
php
public function getTypeModifier() : floatReturns the multiplier by which this enchantment type's EPF increases with each enchantment level.
isApplicable()
php
public function isApplicable(\pocketmine\event\entity\EntityDamageEvent $event) : boolReturns whether this enchantment type offers protection from the specified damage source's cause.
