SculkShrieker 5.46.0
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
public const DARKNESS_DURATION_TICKS = 260DARKNESS_RADIUS
public const DARKNESS_RADIUS = 40DARKNESS_RENEW_TICKS
public const DARKNESS_RENEW_TICKS = 200Darkness is renewed when the current one has less than this left (Java displayEffectLimit)
SHRIEKING_TICKS
public const SHRIEKING_TICKS = 90WARDEN_SPAWN_ATTEMPTS
public const WARDEN_SPAWN_ATTEMPTS = 20WARDEN_SPAWN_RANGE_XZ
public const WARDEN_SPAWN_RANGE_XZ = 5WARDEN_SPAWN_RANGE_Y
public const WARDEN_SPAWN_RANGE_Y = 6WARNING_SOUND_RADIUS
public const WARNING_SOUND_RADIUS = 10Properties
$active protected
protected bool $active$canSummon protected
protected bool $canSummonMethods
applyDarknessAround()
public function applyDarknessAround() : voidGives Darkness to the players in survival or adventure mode within 40 blocks.
canRespond()
public function canRespond() : boolReturns 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()
public function canSummon() : booldescribeBlockOnlyState() protected
protected function describeBlockOnlyState(\pocketmine\data\runtime\RuntimeDataDescriber $w) : voidgetDropsForCompatibleTool()
public function getDropsForCompatibleTool(\pocketmine\item\Item $item) : arraygetSupportType()
public function getSupportType(int $facing) : \pocketmine\block\utils\SupportTypegetXpDropAmount()
public function getXpDropAmount() : inthasEntityCollision()
public function hasEntityCollision() : boolisActive()
public function isActive() : boolisAffectedBySilkTouch()
public function isAffectedBySilkTouch() : boolonBreak()
public function onBreak(\pocketmine\item\Item $item, ?\pocketmine\player\Player $player = null, array &$returnedItems = []) : boolonEntityInside()
public function onEntityInside(\pocketmine\entity\Entity $entity) : boolonNearbyBlockChange()
public function onNearbyBlockChange() : voidonScheduledUpdate()
public function onScheduledUpdate() : voidrecalculateCollisionBoxes() protected
protected function recalculateCollisionBoxes() : arraysetActive()
public function setActive(bool $active) : selfsetCanSummon()
public function setCanSummon(bool $canSummon) : selftryShriek()
public function tryShriek(\pocketmine\player\Player $player) : boolJava SculkShriekerBlockEntity.tryShriek(): the player set the shrieker off. Returns whether it shrieked.
tryShriekWithTrackers()
public function tryShriekWithTrackers(array $trackers) : boolSame as SculkShrieker::tryShriek() with the warning trackers of the players concerned (the trigger player and the players around).
trySummonWarden()
public function trySummonWarden() : ?\pocketmine\entity\monster\WardenSummons 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).
