Scaffolding 5.46.0
Extends Transparent
Implements Fallable
Scaffolding, with the Bedrock rules.
Its stability is the horizontal distance to a scaffolding column standing on a block with a full top face: 0 on such a block, the same as the scaffolding below it, otherwise the lowest horizontal neighbour + 1. 7 means that it is unsupported:
- scaffolding that was never supported (placed more than 6 blocks out, or in mid-air) falls like sand, and lands as scaffolding where it can stand (otherwise it drops as an item);
- scaffolding that loses its support breaks and drops itself, so removing the bottom of a column, or the column holding an overhang, takes down everything that depended on it, one block per tick.
Placement (Bedrock): scaffolding goes against the clicked face like any other block (the client picks the face from where the player looks, also from inside scaffolding), except that placing it into scaffolding, or against the bottom face of scaffolding, puts it on top of that scaffolding column. Entities don't stop it from being placed. Climbing, walking through it and sneaking down are handled by the client; only the top planks collide.
Constants
MAX_STABILITY
public const MAX_STABILITY = 7Methods
calculateStability()
public static function calculateStability(\pocketmine\world\World $world, \pocketmine\math\Vector3 $pos) : intReturns the stability scaffolding would have at the given position.
canBePlacedAt()
public function canBePlacedAt(\pocketmine\block\Block $blockReplace, \pocketmine\math\Vector3 $clickVector, int $face, bool $isClickedBlock) : boolcanClimb()
public function canClimb() : booldescribeBlockOnlyState() protected
protected function describeBlockOnlyState(\pocketmine\data\runtime\RuntimeDataDescriber $w) : voidgetFallDamagePerBlock()
public function getFallDamagePerBlock() : floatgetFlameEncouragement()
public function getFlameEncouragement() : intgetFlammability()
public function getFlammability() : intgetLandSound()
public function getLandSound() : ?\pocketmine\world\sound\SoundgetMaxFallDamage()
public function getMaxFallDamage() : floatgetStability()
public function getStability() : intgetSupportType()
public function getSupportType(int $facing) : \pocketmine\block\utils\SupportTypehasEntityCollision()
public function hasEntityCollision() : boolisPlacementObstructedByEntities()
public function isPlacementObstructedByEntities() : boolisStabilityCheck()
public function isStabilityCheck() : boolVanilla "stability_check" state: set on scaffolding placed by a player until its stability has been checked, one tick later. Whether unsupported scaffolding falls or breaks depends on its stored stability, not on this.
onEntityInside()
public function onEntityInside(\pocketmine\entity\Entity $entity) : boolonHitGround()
public function onHitGround(\pocketmine\entity\object\FallingBlock $blockEntity) : boolonNearbyBlockChange()
public function onNearbyBlockChange() : voidonScheduledUpdate()
public function onScheduledUpdate() : voidplace()
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) : boolrecalculateCollisionBoxes() protected
protected function recalculateCollisionBoxes() : arraysetStability()
public function setStability(int $stability) : selfsetStabilityCheck()
public function setStabilityCheck(bool $stabilityCheck) : selftickFalling()
public function tickFalling() : ?\pocketmine\block\Block