ArmorStand 5.46.0
Extends Living
Armor stand (https://minecraft.wiki/w/Armor_Stand). Holds four armor pieces and an item in its hand:
- using an armor piece on it swaps it with the matching slot, any other item swaps with the hand;
- using an empty hand takes the item at the height that was clicked (or the hand item);
- sneaking with an empty hand cycles through the 13 poses;
- a hit from a creative player removes it, otherwise it breaks after 6 damage and drops itself and its items.
Constants
MAX_POSE
php
public const MAX_POSE = 12Properties
$mainHand protected
php
protected \pocketmine\inventory\SimpleInventory $mainHand$pose protected
php
protected int $poseMethods
attack()
php
public function attack(\pocketmine\event\entity\EntityDamageEvent $source) : voidgetDrops()
php
public function getDrops() : arraygetInitialSizeInfo() protected
php
protected function getInitialSizeInfo() : \pocketmine\entity\EntitySizeInfogetMainHandItem()
php
public function getMainHandItem() : \pocketmine\item\ItemgetName()
php
public function getName() : stringgetNetworkTypeId()
php
public static function getNetworkTypeId() : stringgetPickedItem()
php
public function getPickedItem() : ?\pocketmine\item\ItemgetPose()
php
public function getPose() : intgetSlotAtHeight()
php
public function getSlotAtHeight(float $y) : ?intReturns the armor slot, or null for the hand, that a click at the given height (relative to the feet) reaches. Like vanilla, an empty slot at that height falls back to the hand.
getXpDropAmount()
php
public function getXpDropAmount() : intinitEntity() protected
php
protected function initEntity(\pocketmine\nbt\tag\CompoundTag $nbt) : voidknockBack()
php
public function knockBack(float $x, float $z, float $force = self::DEFAULT_KNOCKBACK_FORCE, ?float $verticalLimit = self::DEFAULT_KNOCKBACK_VERTICAL_LIMIT) : voidonDispose() protected
php
protected function onDispose() : voidonInteract()
php
public function onInteract(\pocketmine\player\Player $player, \pocketmine\math\Vector3 $clickPos) : boolplayPlaceSound()
php
public function playPlaceSound() : voidPlays the sound of an armor stand being placed.
saveNBT()
php
public function saveNBT() : \pocketmine\nbt\tag\CompoundTagsendSpawnPacket() protected
php
protected function sendSpawnPacket(\pocketmine\player\Player $player) : voidsetMainHandItem()
php
public function setMainHandItem(\pocketmine\item\Item $item) : voidsetPose()
php
public function setPose(int $pose) : voidstartDeathAnimation() protected
php
protected function startDeathAnimation() : voidsyncNetworkData() protected
php
protected function syncNetworkData(\pocketmine\network\mcpe\protocol\types\entity\EntityMetadataCollection $properties) : void