Shulker 5.46.0
Extends Monster
Bedrock values (shulker.json): 30 health, 1x1 box that never moves, fire immune. Attached to the block below it.
- Peeks out now and then; opens fully while it has a target within 16 blocks and shoots a homing bullet every 1-3 seconds (see
ShulkerBullet). Closed, it is armored: projectiles bounce off it. - When hurt below half health it may teleport (25%) to another spot within 8 blocks where it can attach; it also teleports when the block it sits on disappears.
- Colour: VARIANT 16 (undyed) or the dye colour; creative players can dye it (vanilla interact filters). Loot: 0-1 shulker shell (+0-1 per Looting level). Experience 5. Only the "down" attachment is implemented: shulkers always sit on top of a block.
Constants
PEEK_IDLE
php
public const PEEK_IDLE = 30PEEK_OPEN
php
public const PEEK_OPEN = 100TAG_COLOR
php
public const TAG_COLOR = "Color"UNDYED
php
public const UNDYED = 16Methods
attack()
php
public function attack(\pocketmine\event\entity\EntityDamageEvent $source) : voidcanAttachAt()
php
public function canAttachAt(int $x, int $y, int $z) : boolReturns whether a shulker can sit at the given block position: room for it and a block to sit on.
entityBaseTick() protected
php
protected function entityBaseTick(int $tickDiff = 1) : boolgetColor()
php
public function getColor() : ?\pocketmine\block\utils\DyeColorgetDrops()
php
public function getDrops() : arraygetInitialSizeInfo() protected
php
protected function getInitialSizeInfo() : \pocketmine\entity\EntitySizeInfogetName()
php
public function getName() : stringgetNetworkTypeId()
php
public static function getNetworkTypeId() : stringgetPeek()
php
public function getPeek() : intgetPickedItem()
php
public function getPickedItem() : ?\pocketmine\item\ItemgetXpDropAmount()
php
public function getXpDropAmount() : inthasMovementUpdate()
php
public function hasMovementUpdate() : boolinitEntity() protected
php
protected function initEntity(\pocketmine\nbt\tag\CompoundTag $nbt) : voidisFireProof()
php
public function isFireProof() : boolisShellClosed()
php
public function isShellClosed() : boolknockBack()
php
public function knockBack(float $x, float $z, float $force = self::DEFAULT_KNOCKBACK_FORCE, ?float $verticalLimit = self::DEFAULT_KNOCKBACK_VERTICAL_LIMIT) : voidonInteractWithItem() protected
php
protected function onInteractWithItem(\pocketmine\player\Player $player, \pocketmine\item\Item $item) : boolregisterGoals() protected
php
protected function registerGoals() : voidsaveNBT()
php
public function saveNBT() : \pocketmine\nbt\tag\CompoundTagsetColor()
php
public function setColor(?\pocketmine\block\utils\DyeColor $color) : voidsetPeek()
php
public function setPeek(int $peek) : voidshootBullet()
php
public function shootBullet(\pocketmine\entity\Living $target) : \pocketmine\entity\projectile\ShulkerBulletShoots a homing bullet at the target.
syncNetworkData() protected
php
protected function syncNetworkData(\pocketmine\network\mcpe\protocol\types\entity\EntityMetadataCollection $properties) : voidtryChangeMovement() protected
php
protected function tryChangeMovement() : voidtryTeleport()
php
public function tryTeleport() : boolTeleports to a random free spot within 8 blocks where it can attach (vanilla: 5 tries). Returns whether it moved.
