Skip to content

Shulker 5.46.0 ​

class · pocketmine\entity\monster\Shulker · source

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

PEEK_OPEN ​

php
public const PEEK_OPEN = 100

TAG_COLOR ​

php
public const TAG_COLOR = "Color"

UNDYED ​

php
public const UNDYED = 16

Methods ​

attack() ​

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

canAttachAt() ​

php
public function canAttachAt(int $x, int $y, int $z) : bool

Returns 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) : bool

getColor() ​

php
public function getColor() : ?\pocketmine\block\utils\DyeColor

getDrops() ​

php
public function getDrops() : array

getInitialSizeInfo() protected ​

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

getName() ​

php
public function getName() : string

getNetworkTypeId() ​

php
public static function getNetworkTypeId() : string

getPeek() ​

php
public function getPeek() : int

getPickedItem() ​

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

getXpDropAmount() ​

php
public function getXpDropAmount() : int

hasMovementUpdate() ​

php
public function hasMovementUpdate() : bool

initEntity() protected ​

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

isFireProof() ​

php
public function isFireProof() : bool

isShellClosed() ​

php
public function isShellClosed() : bool

knockBack() ​

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

onInteractWithItem() protected ​

php
protected function onInteractWithItem(\pocketmine\player\Player $player, \pocketmine\item\Item $item) : bool

registerGoals() protected ​

php
protected function registerGoals() : void

saveNBT() ​

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

setColor() ​

php
public function setColor(?\pocketmine\block\utils\DyeColor $color) : void

setPeek() ​

php
public function setPeek(int $peek) : void

shootBullet() ​

php
public function shootBullet(\pocketmine\entity\Living $target) : \pocketmine\entity\projectile\ShulkerBullet

Shoots a homing bullet at the target.

syncNetworkData() protected ​

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

tryChangeMovement() protected ​

php
protected function tryChangeMovement() : void

tryTeleport() ​

php
public function tryTeleport() : bool

Teleports to a random free spot within 8 blocks where it can attach (vanilla: 5 tries). Returns whether it moved.

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