MobEquipment 5.47.0
Equipment slots of mobs (the four armor slots of ArmorInventory and both hands, see HeldItemsTrait) and helpers shared by spawn equipment and equipment drops.
Constants
DEFAULT_DROP_CHANCE
public const DEFAULT_DROP_CHANCE = 85Vanilla drop chance of equipment a mob spawned with, when killed by a player (Java 8.5%, +1% per Looting level), in 1000ths.
LOOTING_DROP_CHANCE
public const LOOTING_DROP_CHANCE = 10SLOT_CHEST
public const SLOT_CHEST = \pocketmine\inventory\ArmorInventory::SLOT_CHESTSLOT_FEET
public const SLOT_FEET = \pocketmine\inventory\ArmorInventory::SLOT_FEETSLOT_HEAD
public const SLOT_HEAD = \pocketmine\inventory\ArmorInventory::SLOT_HEADSLOT_LEGS
public const SLOT_LEGS = \pocketmine\inventory\ArmorInventory::SLOT_LEGSSLOT_MAINHAND
public const SLOT_MAINHAND = 4SLOT_OFFHAND
public const SLOT_OFFHAND = 5TAG_CAN_PICK_UP_LOOT
public const TAG_CAN_PICK_UP_LOOT = "CanPickUpLoot"Whether the mob picks up items (Java CanPickUpLoot; rolled at spawn for behavior.pickup_items pickup_based_on_chance).
TAG_GUARANTEED_DROPS
public const TAG_GUARANTEED_DROPS = "GuaranteedDrops"Bit mask of the slots always dropped on death (PocketMine).
TAG_NO_DROPS
public const TAG_NO_DROPS = "NoDropSlots"Bit mask of the slots never dropped on death (PocketMine; vanilla drop chance 0).
Methods
getSlotFor()
public static function getSlotFor(\pocketmine\item\Item $item) : intReturns the slot an item goes to when equipped: armor in its armor slot, heads and carved pumpkins on the head, banners on the chest (the ominous banner of raid captains), nautilus shells, shields and totems in the off hand, anything else in the main hand.
isFreshSpawn()
public static function isFreshSpawn(?\pocketmine\nbt\tag\CompoundTag $nbt) : boolWhether the saved data is the one of a freshly created mob (no saved hands nor armor), which should roll its spawn equipment. Mobs saved before they had equipment keep what they had.
randomizeDropDamage()
public static function randomizeDropDamage(\pocketmine\item\Item $item) : \pocketmine\item\ItemDamages a dropped spawned equipment item like vanilla (Java Mob.dropCustomDeathLoot): it keeps a random, usually small, part of its durability.
