Skip to content

Fence ​

class · pocketmine\block\Fence · source

Extends Transparent
Implements HorizontalConnections

Methods ​

canConnectTo() 5.46.0 protected ​

php
protected function canConnectTo(\pocketmine\block\Block $block, int $facing) : bool

describeBlockOnlyState() 5.46.0 protected ​

php
protected function describeBlockOnlyState(\pocketmine\data\runtime\RuntimeDataDescriber $w) : void

Since 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\SupportType

getThickness() ​

php
public function getThickness() : float

onInteract() 5.46.0 ​

php
public function onInteract(\pocketmine\item\Item $item, int $face, \pocketmine\math\Vector3 $clickVector, ?\pocketmine\player\Player $player = null, array &$returnedItems = []) : bool

Using a fence ties the mobs the player leads to it (see LeashKnot).

onNearbyBlockChange() 5.46.0 ​

php
public function onNearbyBlockChange() : void

place() 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) : bool

recalculateCollisionBoxes() protected ​

php
protected function recalculateCollisionBoxes() : array

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