DetectorRail
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 = 20Ticks between checks while a minecart is on the rail.
Properties
$activated protected
php
protected bool $activatedMethods
checkActivators() 5.46.0
php
public function checkActivators() : voidUpdates the activated state from the minecarts on the rail.
describeBlockOnlyState() protected
php
protected function describeBlockOnlyState(\pocketmine\data\runtime\RuntimeDataDescriber $w) : voidgetComparatorOutput() 5.46.0
php
public function getComparatorOutput() : intgetStrongPower() 5.46.0
php
public function getStrongPower(int $face) : intgetWeakPower() 5.46.0
php
public function getWeakPower(int $face) : inthasEntityCollision() 5.46.0
php
public function hasEntityCollision() : boolisActivated()
php
public function isActivated() : 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 = []) : boolonEntityInside() 5.46.0
php
public function onEntityInside(\pocketmine\entity\Entity $entity) : boolonScheduledUpdate() 5.46.0
php
public function onScheduledUpdate() : voidsetActivated()
php
public function setActivated(bool $activated) : self