Skip to content

MobEquipment 5.47.0 ​

final class · pocketmine\entity\monster\MobEquipment · source

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 ​

php
public const DEFAULT_DROP_CHANCE = 85

Vanilla 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 ​

php
public const LOOTING_DROP_CHANCE = 10

SLOT_CHEST ​

php
public const SLOT_CHEST = \pocketmine\inventory\ArmorInventory::SLOT_CHEST

SLOT_FEET ​

php
public const SLOT_FEET = \pocketmine\inventory\ArmorInventory::SLOT_FEET

SLOT_HEAD ​

php
public const SLOT_HEAD = \pocketmine\inventory\ArmorInventory::SLOT_HEAD

SLOT_LEGS ​

php
public const SLOT_LEGS = \pocketmine\inventory\ArmorInventory::SLOT_LEGS

SLOT_MAINHAND ​

php
public const SLOT_MAINHAND = 4

SLOT_OFFHAND ​

php
public const SLOT_OFFHAND = 5

TAG_CAN_PICK_UP_LOOT ​

php
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 ​

php
public const TAG_GUARANTEED_DROPS = "GuaranteedDrops"

Bit mask of the slots always dropped on death (PocketMine).

TAG_NO_DROPS ​

php
public const TAG_NO_DROPS = "NoDropSlots"

Bit mask of the slots never dropped on death (PocketMine; vanilla drop chance 0).

Methods ​

getSlotFor() ​

php
public static function getSlotFor(\pocketmine\item\Item $item) : int

Returns 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() ​

php
public static function isFreshSpawn(?\pocketmine\nbt\tag\CompoundTag $nbt) : bool

Whether 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() ​

php
public static function randomizeDropDamage(\pocketmine\item\Item $item) : \pocketmine\item\Item

Damages a dropped spawned equipment item like vanilla (Java Mob.dropCustomDeathLoot): it keeps a random, usually small, part of its durability.

VanillaMine is a fork of PocketMine-MP. Not affiliated with the PMMP team or Mojang.