Fence
Extends Transparent
Implements HorizontalConnections
Methods
canConnectTo() 5.46.0 protected
php
protected function canConnectTo(\pocketmine\block\Block $block, int $facing) : booldescribeBlockOnlyState() 5.46.0 protected
php
protected function describeBlockOnlyState(\pocketmine\data\runtime\RuntimeDataDescriber $w) : voidSince 1.26.50 the client no longer infers fence connections from the neighbours: they're real block states (minecraft:connection_*), so they have to be part of our state too and kept up to date on block changes.
getSupportType()
php
public function getSupportType(int $facing) : \pocketmine\block\utils\SupportTypegetThickness()
php
public function getThickness() : floatonInteract() 5.46.0
php
public function onInteract(\pocketmine\item\Item $item, int $face, \pocketmine\math\Vector3 $clickVector, ?\pocketmine\player\Player $player = null, array &$returnedItems = []) : boolUsing a fence ties the mobs the player leads to it (see LeashKnot).
onNearbyBlockChange() 5.46.0
php
public function onNearbyBlockChange() : voidplace() 5.46.0
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) : boolrecalculateCollisionBoxes() protected
php
protected function recalculateCollisionBoxes() : array