SculkSensor 5.46.0
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
public const ACTIVE_TICKS = 30COOLDOWN_TICKS
public const COOLDOWN_TICKS = 10PHASE_ACTIVE
public const PHASE_ACTIVE = 1PHASE_COOLDOWN
public const PHASE_COOLDOWN = 2PHASE_INACTIVE
public const PHASE_INACTIVE = 0RANGE
public const RANGE = 8Properties
$phase protected
protected int $phaseMethods
activate()
public function activate(int $power, int $frequency, ?int $sourceEntityId = null) : voidStarts the active phase with the given output. The sculk shriekers within 8 blocks hear the sensor if a player caused the vibration.
canDetect()
public function canDetect(int $frequency) : boolReturns whether this sensor can start listening to a vibration of the given frequency right now.
describeBlockOnlyState() protected
protected function describeBlockOnlyState(\pocketmine\data\runtime\RuntimeDataDescriber $w) : voidgetActiveTicks() protected
protected function getActiveTicks() : intgetComparatorOutput()
public function getComparatorOutput() : intgetLightLevel()
public function getLightLevel() : intgetOutputPower()
public function getOutputPower() : intReturns the redstone power this sensor outputs (0 unless active).
getPhase()
public function getPhase() : intgetRange()
public function getRange() : intReturns the maximum distance (in blocks) of the vibrations this sensor can detect.
getStrongPower()
public function getStrongPower(int $face) : intgetSupportType()
public function getSupportType(int $facing) : \pocketmine\block\utils\SupportTypegetWeakPower()
public function getWeakPower(int $face) : intgetXpDropAmount()
public function getXpDropAmount() : inthasEntityCollision()
public function hasEntityCollision() : boolisActive()
public function isActive() : boolisAffectedBySilkTouch()
public function isAffectedBySilkTouch() : boolisRedstoneSource()
public function isRedstoneSource() : 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() : arraysetPhase()
public function setPhase(int $phase) : self