Skip to content

SculkShrieker 5.46.0 ​

class · pocketmine\block\SculkShrieker · source

Extends Transparent

Sculk shrieker (https://minecraft.wiki/w/Sculk_Shrieker), ported from Java's SculkShriekerBlock(Entity).

It shrieks for 90 ticks ("active" state) when a player steps on it or when a sculk sensor within 8 blocks detects a vibration caused by a player. Shriekers which can summon wardens (natural ones; never those placed by players or grown by a catalyst) raise the warning level of the players around (see WardenSpawnTracker); they don't shriek while the players are on warning cooldown. When the shriek ends, such a shrieker gives Darkness to the players within 40 blocks and either summons a warden (warning level 4) or plays a warden sound nearby.

Constants ​

DARKNESS_DURATION_TICKS ​

php
public const DARKNESS_DURATION_TICKS = 260

DARKNESS_RADIUS ​

php
public const DARKNESS_RADIUS = 40

DARKNESS_RENEW_TICKS ​

php
public const DARKNESS_RENEW_TICKS = 200

Darkness is renewed when the current one has less than this left (Java displayEffectLimit)

SHRIEKING_TICKS ​

php
public const SHRIEKING_TICKS = 90

WARDEN_SPAWN_ATTEMPTS ​

php
public const WARDEN_SPAWN_ATTEMPTS = 20

WARDEN_SPAWN_RANGE_XZ ​

php
public const WARDEN_SPAWN_RANGE_XZ = 5

WARDEN_SPAWN_RANGE_Y ​

php
public const WARDEN_SPAWN_RANGE_Y = 6

WARNING_SOUND_RADIUS ​

php
public const WARNING_SOUND_RADIUS = 10

Properties ​

$active protected ​

php
protected bool $active

$canSummon protected ​

php
protected bool $canSummon

Methods ​

applyDarknessAround() ​

php
public function applyDarknessAround() : void

Gives Darkness to the players in survival or adventure mode within 40 blocks.

canRespond() ​

php
public function canRespond() : bool

Returns whether this shrieker can warn players and summon wardens: it must be allowed to (natural shriekers), the difficulty must not be peaceful and mobs must be enabled.

canSummon() ​

php
public function canSummon() : bool

describeBlockOnlyState() protected ​

php
protected function describeBlockOnlyState(\pocketmine\data\runtime\RuntimeDataDescriber $w) : void

getDropsForCompatibleTool() ​

php
public function getDropsForCompatibleTool(\pocketmine\item\Item $item) : array

getSupportType() ​

php
public function getSupportType(int $facing) : \pocketmine\block\utils\SupportType

getXpDropAmount() ​

php
public function getXpDropAmount() : int

hasEntityCollision() ​

php
public function hasEntityCollision() : bool

isActive() ​

php
public function isActive() : bool

isAffectedBySilkTouch() ​

php
public function isAffectedBySilkTouch() : bool

onBreak() ​

php
public function onBreak(\pocketmine\item\Item $item, ?\pocketmine\player\Player $player = null, array &$returnedItems = []) : bool

onEntityInside() ​

php
public function onEntityInside(\pocketmine\entity\Entity $entity) : bool

onNearbyBlockChange() ​

php
public function onNearbyBlockChange() : void

onScheduledUpdate() ​

php
public function onScheduledUpdate() : void

recalculateCollisionBoxes() protected ​

php
protected function recalculateCollisionBoxes() : array

setActive() ​

php
public function setActive(bool $active) : self

setCanSummon() ​

php
public function setCanSummon(bool $canSummon) : self

tryShriek() ​

php
public function tryShriek(\pocketmine\player\Player $player) : bool

Java SculkShriekerBlockEntity.tryShriek(): the player set the shrieker off. Returns whether it shrieked.

tryShriekWithTrackers() ​

php
public function tryShriekWithTrackers(array $trackers) : bool

Same as SculkShrieker::tryShriek() with the warning trackers of the players concerned (the trigger player and the players around).

trySummonWarden() ​

php
public function trySummonWarden() : ?\pocketmine\entity\monster\Warden

Summons an emerging warden on a block around the shrieker (Java SpawnUtil.trySpawnMob() with the ON_TOP_OF_COLLIDER strategy: 20 attempts within 5 blocks horizontally, from 6 blocks above to 6 below).

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