Skip to content

DetectorRail ​

class · pocketmine\block\DetectorRail · source

Extends StraightOnlyRail
Implements ComparatorReadable

Powered while a minecart (DetectorRailActivator) is on it: weak power of 15 around it and strong power into the block below. Other entities (players, mobs, items) don't activate it, like in vanilla. A comparator reads the fill level of container minecarts on it.

Constants ​

RECHECK_TICKS 5.46.0 ​

php
public const RECHECK_TICKS = 20

Ticks between checks while a minecart is on the rail.

Properties ​

$activated protected ​

php
protected bool $activated

Methods ​

checkActivators() 5.46.0 ​

php
public function checkActivators() : void

Updates the activated state from the minecarts on the rail.

describeBlockOnlyState() protected ​

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

getComparatorOutput() 5.46.0 ​

php
public function getComparatorOutput() : int

getStrongPower() 5.46.0 ​

php
public function getStrongPower(int $face) : int

getWeakPower() 5.46.0 ​

php
public function getWeakPower(int $face) : int

hasEntityCollision() 5.46.0 ​

php
public function hasEntityCollision() : bool

isActivated() ​

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

onEntityInside() 5.46.0 ​

php
public function onEntityInside(\pocketmine\entity\Entity $entity) : bool

onScheduledUpdate() 5.46.0 ​

php
public function onScheduledUpdate() : void

setActivated() ​

php
public function setActivated(bool $activated) : self

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