Skip to content

SculkSensor 5.46.0 ​

class · pocketmine\block\SculkSensor · source

Extends Transparent
Implements ComparatorReadable

Detects vibrations (see \pocketmine\world\vibration\VibrationManager) and outputs a redstone signal which gets weaker with the distance of the vibration. Phases: inactive, active (outputting), cooldown (deaf).

Bedrock has no block state for the output power, so it lives in the world's vibration manager while the sensor is active.

Constants ​

ACTIVE_TICKS ​

php
public const ACTIVE_TICKS = 30

COOLDOWN_TICKS ​

php
public const COOLDOWN_TICKS = 10

PHASE_ACTIVE ​

php
public const PHASE_ACTIVE = 1

PHASE_COOLDOWN ​

php
public const PHASE_COOLDOWN = 2

PHASE_INACTIVE ​

php
public const PHASE_INACTIVE = 0

RANGE ​

php
public const RANGE = 8

Properties ​

$phase protected ​

php
protected int $phase

Methods ​

activate() ​

php
public function activate(int $power, int $frequency, ?int $sourceEntityId = null) : void

Starts the active phase with the given output. The sculk shriekers within 8 blocks hear the sensor if a player caused the vibration.

canDetect() ​

php
public function canDetect(int $frequency) : bool

Returns whether this sensor can start listening to a vibration of the given frequency right now.

describeBlockOnlyState() protected ​

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

getActiveTicks() protected ​

php
protected function getActiveTicks() : int

getComparatorOutput() ​

php
public function getComparatorOutput() : int

getLightLevel() ​

php
public function getLightLevel() : int

getOutputPower() ​

php
public function getOutputPower() : int

Returns the redstone power this sensor outputs (0 unless active).

getPhase() ​

php
public function getPhase() : int

getRange() ​

php
public function getRange() : int

Returns the maximum distance (in blocks) of the vibrations this sensor can detect.

getStrongPower() ​

php
public function getStrongPower(int $face) : int

getSupportType() ​

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

getWeakPower() ​

php
public function getWeakPower(int $face) : int

getXpDropAmount() ​

php
public function getXpDropAmount() : int

hasEntityCollision() ​

php
public function hasEntityCollision() : bool

isActive() ​

php
public function isActive() : bool

isAffectedBySilkTouch() ​

php
public function isAffectedBySilkTouch() : bool

isRedstoneSource() ​

php
public function isRedstoneSource() : 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

setPhase() ​

php
public function setPhase(int $phase) : self

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