Skip to content

ProtectionEnchantment ​

class · pocketmine\item\enchantment\ProtectionEnchantment · source

Extends Enchantment

Properties ​

$applicableDamageTypes protected ​

php
protected ?array $applicableDamageTypes

$typeModifier protected ​

php
protected float $typeModifier

Methods ​

__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) : int

Returns the base EPF this enchantment type offers for the given enchantment level.

getTypeModifier() ​

php
public function getTypeModifier() : float

Returns the multiplier by which this enchantment type's EPF increases with each enchantment level.

isApplicable() ​

php
public function isApplicable(\pocketmine\event\entity\EntityDamageEvent $event) : bool

Returns whether this enchantment type offers protection from the specified damage source's cause.

VanillaMine is a fork of PocketMine-MP, maintained by Luxury Nodes. Not affiliated with the PMMP team or Mojang.