Skip to content

BoatPlacementTrait 5.46.0 ​

trait · pocketmine\item\BoatPlacementTrait · source

Places a boat where the player points (vanilla BoatItem.use()): on the water surface, or on a block (Bedrock boats can be placed on land too). The boat faces the way the player looks.

Methods ​

canPlaceBoatAt() ​

php
public static function canPlaceBoatAt(\pocketmine\world\World $world, \pocketmine\math\Vector3 $pos) : bool

Returns whether a boat fits at the given position (no block in the way).

getBoatVariant() ​

php
abstract public function getBoatVariant() : \pocketmine\entity\vehicle\BoatVariant

The wood of the boat this item places.

getMaxStackSize() ​

php
public function getMaxStackSize() : int

onClickAir() ​

php
public function onClickAir(\pocketmine\player\Player $player, \pocketmine\math\Vector3 $directionVector, array &$returnedItems) : \pocketmine\item\ItemUseResult

onInteractBlock() ​

php
public function onInteractBlock(\pocketmine\player\Player $player, \pocketmine\block\Block $blockReplace, \pocketmine\block\Block $blockClicked, int $face, \pocketmine\math\Vector3 $clickVector, array &$returnedItems) : \pocketmine\item\ItemUseResult

placesChestBoat() ​

php
abstract public function placesChestBoat() : bool

Whether this item places a boat with chest.

spawnBoat() ​

php
public function spawnBoat(\pocketmine\world\World $world, \pocketmine\math\Vector3 $pos, float $yaw = 0.0) : \pocketmine\entity\vehicle\Boat

Creates and spawns the boat of this item at the given position (its bottom centre). Does not consume the item.

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