Skip to content

ArmorStand 5.46.0 ​

class · pocketmine\entity\object\ArmorStand · source

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 = 12

Properties ​

$mainHand protected ​

php
protected \pocketmine\inventory\SimpleInventory $mainHand

$pose protected ​

php
protected int $pose

Methods ​

attack() ​

php
public function attack(\pocketmine\event\entity\EntityDamageEvent $source) : void

getDrops() ​

php
public function getDrops() : array

getInitialSizeInfo() protected ​

php
protected function getInitialSizeInfo() : \pocketmine\entity\EntitySizeInfo

getMainHandItem() ​

php
public function getMainHandItem() : \pocketmine\item\Item

getName() ​

php
public function getName() : string

getNetworkTypeId() ​

php
public static function getNetworkTypeId() : string

getPickedItem() ​

php
public function getPickedItem() : ?\pocketmine\item\Item

getPose() ​

php
public function getPose() : int

getSlotAtHeight() ​

php
public function getSlotAtHeight(float $y) : ?int

Returns 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() : int

initEntity() protected ​

php
protected function initEntity(\pocketmine\nbt\tag\CompoundTag $nbt) : void

knockBack() ​

php
public function knockBack(float $x, float $z, float $force = self::DEFAULT_KNOCKBACK_FORCE, ?float $verticalLimit = self::DEFAULT_KNOCKBACK_VERTICAL_LIMIT) : void

onDispose() protected ​

php
protected function onDispose() : void

onInteract() ​

php
public function onInteract(\pocketmine\player\Player $player, \pocketmine\math\Vector3 $clickPos) : bool

playPlaceSound() ​

php
public function playPlaceSound() : void

Plays the sound of an armor stand being placed.

saveNBT() ​

php
public function saveNBT() : \pocketmine\nbt\tag\CompoundTag

sendSpawnPacket() protected ​

php
protected function sendSpawnPacket(\pocketmine\player\Player $player) : void

setMainHandItem() ​

php
public function setMainHandItem(\pocketmine\item\Item $item) : void

setPose() ​

php
public function setPose(int $pose) : void

startDeathAnimation() protected ​

php
protected function startDeathAnimation() : void

syncNetworkData() protected ​

php
protected function syncNetworkData(\pocketmine\network\mcpe\protocol\types\entity\EntityMetadataCollection $properties) : void

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