Skip to content

Observer 5.46.0 ​

class · pocketmine\block\Observer · source

Extends Opaque
Implements AnyFacing

Watches the block in front of it (its facing) and, one redstone tick after that block's state changes, emits a one redstone tick pulse of strong power out of its back.

Changes are reported by the redstone engine (RedstoneEngine::notifyObservers()), which looks at the six neighbours of each changed block. Two observers facing each other make a clock, paced by the scheduled updates.

Constants ​

DELAY_TICKS ​

php
public const DELAY_TICKS = \pocketmine\world\redstone\RedstoneEngine::REDSTONE_TICK

PULSE_TICKS ​

php
public const PULSE_TICKS = \pocketmine\world\redstone\RedstoneEngine::REDSTONE_TICK

Methods ​

connectsToRedstoneWire() ​

php
public function connectsToRedstoneWire(int $face) : bool

describeBlockOnlyState() protected ​

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

getOutputFace() ​

php
public function getOutputFace() : int

Returns the side out of which the observer emits its pulse.

getStrongPower() ​

php
public function getStrongPower(int $face) : int

getWeakPower() ​

php
public function getWeakPower(int $face) : int

isRedstoneConductor() ​

php
public function isRedstoneConductor() : bool

isRedstoneSource() ​

php
public function isRedstoneSource() : bool

onBreak() ​

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

onNearbyBlockChange() ​

php
public function onNearbyBlockChange() : void

onObservedBlockChange() ​

php
public function onObservedBlockChange() : void

Called by the redstone engine when the watched block changes.

onScheduledUpdate() ​

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

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