MovingBlock 5.46.0
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) : voidgetMovingBlock()
php
public function getMovingBlock() : ?\pocketmine\block\BlockgetMovingEntity()
php
public function getMovingEntity() : ?\pocketmine\nbt\tag\CompoundTagReturns the saved NBT of the moved block entity, if any.
getPistonPos()
php
public function getPistonPos() : ?\pocketmine\math\Vector3isExpanding()
php
public function isExpanding() : boolreadSaveData()
php
public function readSaveData(\pocketmine\nbt\tag\CompoundTag $nbt) : voidsetMovement()
php
public function setMovement(\pocketmine\block\Block $block, \pocketmine\math\Vector3 $pistonPos, bool $expanding, ?\pocketmine\nbt\tag\CompoundTag $movingEntity, ?\pocketmine\nbt\tag\CompoundTag $movingEntitySpawnData) : voidwriteSaveData() protected
php
protected function writeSaveData(\pocketmine\nbt\tag\CompoundTag $nbt) : void