BoatPlacementTrait 5.46.0
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) : boolReturns whether a boat fits at the given position (no block in the way).
getBoatVariant()
php
abstract public function getBoatVariant() : \pocketmine\entity\vehicle\BoatVariantThe wood of the boat this item places.
getMaxStackSize()
php
public function getMaxStackSize() : intonClickAir()
php
public function onClickAir(\pocketmine\player\Player $player, \pocketmine\math\Vector3 $directionVector, array &$returnedItems) : \pocketmine\item\ItemUseResultonInteractBlock()
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\ItemUseResultplacesChestBoat()
php
abstract public function placesChestBoat() : boolWhether 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\BoatCreates and spawns the boat of this item at the given position (its bottom centre). Does not consume the item.
