Skip to content

ChestBoat 5.46.0 ​

class · pocketmine\entity\vehicle\ChestBoat · source

Extends Boat

A boat with chest (vanilla minecraft:chest_boat, every wood and the bamboo chest raft): one seat and a 27-slot chest. Sneak-interacting with it, or the inventory button of its passenger, opens the chest. Like container blocks it can hold a loot table ("LootTable" and "LootTableSeed") which fills it the first time it is opened or broken. Broken, it drops itself and its contents.

Constants ​

INVENTORY_SIZE ​

php
public const INVENTORY_SIZE = 27

MAX_VIEW_DISTANCE ​

php
public const MAX_VIEW_DISTANCE = 8.0

Players farther than this from the boat get its window closed.

TAG_CHEST_ITEMS ​

php
public const TAG_CHEST_ITEMS = "ChestItems"

TAG_ITEMS ​

php
public const TAG_ITEMS = "Items"

Properties ​

$inventory protected ​

php
protected \pocketmine\inventory\ChestBoatInventory $inventory

Methods ​

__construct() ​

php
public function __construct(\pocketmine\entity\Location $location, ?\pocketmine\nbt\tag\CompoundTag $nbt = null)

canOpenInventory() ​

php
public function canOpenInventory(\pocketmine\player\Player $player) : bool

Whether the player may open the chest now (close enough, not a spectator).

entityBaseTick() protected ​

php
protected function entityBaseTick(int $tickDiff = 1) : bool

getBoatItem() ​

php
public function getBoatItem() : \pocketmine\item\Item

getInteractButtonText() ​

php
public function getInteractButtonText(\pocketmine\player\Player $player) : string

getInventory() ​

php
public function getInventory() : \pocketmine\inventory\ChestBoatInventory

Returns the inventory, filling it from its loot table first if it has one.

getName() ​

php
public function getName() : string

getNetworkTypeId() ​

php
public static function getNetworkTypeId() : string

getRealInventory() ​

php
public function getRealInventory() : \pocketmine\inventory\ChestBoatInventory

Returns the inventory without filling it from the loot table.

getRideableSeats() ​

php
public function getRideableSeats() : array

initEntity() protected ​

php
protected function initEntity(\pocketmine\nbt\tag\CompoundTag $nbt) : void

onDeath() protected ​

php
protected function onDeath() : void

onDispose() protected ​

php
protected function onDispose() : void

onInteract() ​

php
public function onInteract(\pocketmine\player\Player $player, \pocketmine\math\Vector3 $clickPos) : bool

openInventory() ​

php
public function openInventory(\pocketmine\player\Player $player) : bool

Opens the chest to the player (filling it from its loot table first). Returns whether it opened.

saveNBT() ​

php
public function saveNBT() : \pocketmine\nbt\tag\CompoundTag

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