ChestBoat 5.46.0
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
public const INVENTORY_SIZE = 27MAX_VIEW_DISTANCE
public const MAX_VIEW_DISTANCE = 8.0Players farther than this from the boat get its window closed.
TAG_CHEST_ITEMS
public const TAG_CHEST_ITEMS = "ChestItems"TAG_ITEMS
public const TAG_ITEMS = "Items"Properties
$inventory protected
protected \pocketmine\inventory\ChestBoatInventory $inventoryMethods
__construct()
public function __construct(\pocketmine\entity\Location $location, ?\pocketmine\nbt\tag\CompoundTag $nbt = null)canOpenInventory()
public function canOpenInventory(\pocketmine\player\Player $player) : boolWhether the player may open the chest now (close enough, not a spectator).
entityBaseTick() protected
protected function entityBaseTick(int $tickDiff = 1) : boolgetBoatItem()
public function getBoatItem() : \pocketmine\item\ItemgetInteractButtonText()
public function getInteractButtonText(\pocketmine\player\Player $player) : stringgetInventory()
public function getInventory() : \pocketmine\inventory\ChestBoatInventoryReturns the inventory, filling it from its loot table first if it has one.
getName()
public function getName() : stringgetNetworkTypeId()
public static function getNetworkTypeId() : stringgetRealInventory()
public function getRealInventory() : \pocketmine\inventory\ChestBoatInventoryReturns the inventory without filling it from the loot table.
getRideableSeats()
public function getRideableSeats() : arrayinitEntity() protected
protected function initEntity(\pocketmine\nbt\tag\CompoundTag $nbt) : voidonDeath() protected
protected function onDeath() : voidonDispose() protected
protected function onDispose() : voidonInteract()
public function onInteract(\pocketmine\player\Player $player, \pocketmine\math\Vector3 $clickPos) : boolopenInventory()
public function openInventory(\pocketmine\player\Player $player) : boolOpens the chest to the player (filling it from its loot table first). Returns whether it opened.
saveNBT()
public function saveNBT() : \pocketmine\nbt\tag\CompoundTag