Piston 5.46.0
Extends Opaque
Implements AnyFacing
Piston and sticky piston (Bedrock behaviour).
- Powered from any side except its front (no quasi-connectivity in Bedrock); redstone wire next to it powers it even when it doesn't point into it.
- Starts moving one redstone tick (2 game ticks) after its power changes, and the arm takes 2 game ticks to move. Power changes during a movement are only looked at once it ends.
- Pushes up to 12 blocks (slime and honey blocks drag the blocks stuck to them), destroys blocks which break when pushed, and a sticky piston pulls the block in front of its head back when it retracts.
- Moved blocks keep their block entity data (chests, furnaces...).
The moving blocks are moving_block blocks with a MovingBlock block entity at their destination, and the PistonArm block entity of the piston carries the animation state; see TilePistonArm and TileMovingBlock.
Constants
START_DELAY_TICKS
php
public const START_DELAY_TICKS = \pocketmine\world\redstone\RedstoneEngine::REDSTONE_TICKDelay between a power change and the start of the movement.
Methods
describeBlockOnlyState() protected
php
protected function describeBlockOnlyState(\pocketmine\data\runtime\RuntimeDataDescriber $w) : voidfinishMovement()
php
public function finishMovement(\pocketmine\block\tile\PistonArm $arm) : voidPuts the moved blocks in place and ends the movement.
getAffectedBlocks()
php
public function getAffectedBlocks() : arraygetArm() protected
php
protected function getArm() : ?\pocketmine\block\tile\PistonArmgetPistonPushReaction()
php
public function getPistonPushReaction() : \pocketmine\block\utils\PistonPushReactionisExtended()
php
public function isExtended() : boolReturns whether the piston's arm is out (or moving).
isReceivingPower()
php
public function isReceivingPower() : boolReturns whether the piston receives power from any side except its front.
isRedstoneConductor()
php
public function isRedstoneConductor() : boolisSticky()
php
public function isSticky() : boolonBreak()
php
public function onBreak(\pocketmine\item\Item $item, ?\pocketmine\player\Player $player = null, array &$returnedItems = []) : boolonNearbyBlockChange()
php
public function onNearbyBlockChange() : voidonScheduledUpdate()
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) : boolstartMovement()
php
public function startMovement(\pocketmine\block\tile\PistonArm $arm, bool $extending) : boolStarts extending or retracting the arm. Returns false if the blocks in front can't be pushed.
writeStateToWorld()
php
public function writeStateToWorld() : void