HorseInventory 5.46.0
Extends SimpleInventory
The inventory of a horse, donkey, mule, llama, nautilus... (Bedrock "horse" container, window type HORSE). Its slots are the slots of the client's horse screen, the same way BDS and GeyserMC lay them out:
- slot 0: the saddle, or the carpet of a llama ("horse_equip_items" index 0, HORSE_EQUIP);
- slot 1: the horse armor of a horse, the nautilus armor of a nautilus (HORSE_EQUIP index 1);
- slots 1 and up: the chest of a donkey, mule or llama (LEVEL_ENTITY, "container_items"). The size follows the animal (see
AbstractHorse::getInventorySize()); what each slot accepts is checked byMountInventoryHolder::canHoldInSlot().
Constants
FIRST_CHEST_SLOT
php
public const FIRST_CHEST_SLOT = 1First slot of the chest of a chested animal.
SLOT_ARMOR
php
public const SLOT_ARMOR = 1Body armor slot of the mounts that wear armor (they never have a chest).
SLOT_EQUIP
php
public const SLOT_EQUIP = 0Saddle slot, or the carpet slot of a llama.
Methods
__construct()
php
public function __construct(\pocketmine\entity\riding\MountInventoryHolder $horse, int $size)getHorse()
php
public function getHorse() : \pocketmine\entity\riding\MountInventoryHolderReturns the mount this inventory belongs to (an AbstractHorse, a nautilus...).
