Skip to content

MovingBlock 5.46.0 ​

class · pocketmine\block\tile\MovingBlock · source

Extends Spawnable

Block entity of a block being moved by a piston ("MovingBlock" in Bedrock). It sits at the block's destination while the piston arm moves, and holds the moved block and its block entity.

NBT (Minecraft Wiki "Bedrock Edition level format/Block entity format", PowerNukkitX BlockEntityMovingBlock, GeyserMC PistonBlockEntity::buildMovingBlockTag): movingBlock and movingBlockExtra (block state compounds, main and liquid layer), movingEntity (the moved block entity, optional), pistonPosX/Y/Z (int, the piston base), expanding (byte).

Methods ​

addAdditionalSpawnData() protected ​

php
protected function addAdditionalSpawnData(\pocketmine\nbt\tag\CompoundTag $nbt) : void

getMovingBlock() ​

php
public function getMovingBlock() : ?\pocketmine\block\Block

getMovingEntity() ​

php
public function getMovingEntity() : ?\pocketmine\nbt\tag\CompoundTag

Returns the saved NBT of the moved block entity, if any.

getPistonPos() ​

php
public function getPistonPos() : ?\pocketmine\math\Vector3

isExpanding() ​

php
public function isExpanding() : bool

readSaveData() ​

php
public function readSaveData(\pocketmine\nbt\tag\CompoundTag $nbt) : void

setMovement() ​

php
public function setMovement(\pocketmine\block\Block $block, \pocketmine\math\Vector3 $pistonPos, bool $expanding, ?\pocketmine\nbt\tag\CompoundTag $movingEntity, ?\pocketmine\nbt\tag\CompoundTag $movingEntitySpawnData) : void

writeSaveData() protected ​

php
protected function writeSaveData(\pocketmine\nbt\tag\CompoundTag $nbt) : void

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