TripwireHook
Extends Flowable
Implements HorizontalFacing
Hooks facing each other, up to TripwireHook::MAX_DISTANCE blocks apart, with an unbroken line of tripwire between them, are attached. An entity on any wire of the line powers both hooks: they emit a signal of 15 around them and strongly power the block they hang on.
Constants
MAX_DISTANCE 5.46.0
php
public const MAX_DISTANCE = 41Farthest distance between two attached hooks.
RECHECK_TICKS 5.46.0
php
public const RECHECK_TICKS = 10Ticks between checks of a line, after a wire changed.
Properties
$connected protected
php
protected bool $connected$powered protected
php
protected bool $poweredMethods
describeBlockOnlyState() protected
php
protected function describeBlockOnlyState(\pocketmine\data\runtime\RuntimeDataDescriber $w) : voidgetStrongPower() 5.46.0
php
public function getStrongPower(int $face) : intgetWeakPower() 5.46.0
php
public function getWeakPower(int $face) : intisConnected()
php
public function isConnected() : boolisPowered()
php
public function isPowered() : boolisRedstoneSource() 5.46.0
php
public function isRedstoneSource() : boolonBreak() 5.46.0
php
public function onBreak(\pocketmine\item\Item $item, ?\pocketmine\player\Player $player = null, array &$returnedItems = []) : boolonNearbyBlockChange() 5.46.0
php
public function onNearbyBlockChange() : voidonPostPlace() 5.46.0
php
public function onPostPlace() : voidonScheduledUpdate() 5.46.0
php
public function onScheduledUpdate() : voidplace()
php
public function place(\pocketmine\world\BlockTransaction $tx, \pocketmine\item\Item $item, \pocketmine\block\Block $blockReplace, \pocketmine\block\Block $blockClicked, int $face, \pocketmine\math\Vector3 $clickVector, ?\pocketmine\player\Player $player = null) : boolsetConnected()
php
public function setConnected(bool $connected) : selfsetPowered()
php
public function setPowered(bool $powered) : selfupdateLine() 5.46.0
php
public function updateLine(bool $removed, int $sourceDistance = -1, ?\pocketmine\block\Tripwire $sourceWire = null) : voidRecalculates the line starting at this hook: whether it is attached to a hook facing it, whether any wire is triggered, and updates both hooks and the wires in between.
