Skip to content

TripwireHook ​

class · pocketmine\block\TripwireHook · source

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 = 41

Farthest distance between two attached hooks.

RECHECK_TICKS 5.46.0 ​

php
public const RECHECK_TICKS = 10

Ticks between checks of a line, after a wire changed.

Properties ​

$connected protected ​

php
protected bool $connected

$powered protected ​

php
protected bool $powered

Methods ​

describeBlockOnlyState() protected ​

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

getStrongPower() 5.46.0 ​

php
public function getStrongPower(int $face) : int

getWeakPower() 5.46.0 ​

php
public function getWeakPower(int $face) : int

isConnected() ​

php
public function isConnected() : bool

isPowered() ​

php
public function isPowered() : bool

isRedstoneSource() 5.46.0 ​

php
public function isRedstoneSource() : bool

onBreak() 5.46.0 ​

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

onNearbyBlockChange() 5.46.0 ​

php
public function onNearbyBlockChange() : void

onPostPlace() 5.46.0 ​

php
public function onPostPlace() : void

onScheduledUpdate() 5.46.0 ​

php
public function onScheduledUpdate() : void

place() ​

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) : bool

setConnected() ​

php
public function setConnected(bool $connected) : self

setPowered() ​

php
public function setPowered(bool $powered) : self

updateLine() 5.46.0 ​

php
public function updateLine(bool $removed, int $sourceDistance = -1, ?\pocketmine\block\Tripwire $sourceWire = null) : void

Recalculates 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.

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