Documentation

Chest extends Spawnable
in package
implements Container, Nameable Uses NameableTrait, ContainerTrait

Interfaces, Classes, Traits and Enums

Container
Nameable

Table of Contents

TAG_ID  = "id"
TAG_PAIR_LEAD  = "pairlead"
TAG_PAIRX  = "pairx"
TAG_PAIRZ  = "pairz"
TAG_X  = "x"
TAG_Y  = "y"
TAG_Z  = "z"
$closed  : bool
$doubleInventory  : DoubleChestInventory|null
$inventory  : ChestInventory
$position  : Position
$timings  : TimingsHandler
$customName  : string|null
$dirty  : bool
$lock  : string|null
$pairX  : int|null
$pairZ  : int|null
$spawnCompoundCache  : CacheableNbt|null
__construct()  : mixed
__destruct()  : mixed
canOpenWith()  : bool
close()  : void
copyDataFromItem()  : void
getBlock()  : Block
getCleanedNBT()  : CompoundTag|null
getDefaultName()  : string
getInventory()  : ChestInventory|DoubleChestInventory
getName()  : string
getPair()  : Chest|null
getPosition()  : Position
getRealInventory()  : ChestInventory
getSerializedSpawnCompound()  : CacheableNbt
Returns encoded NBT (varint, little-endian) used to spawn this tile to clients. Uses cache where possible, populates cache if it is null.
getSpawnCompound()  : CompoundTag
hasName()  : bool
isClosed()  : bool
isDirty()  : bool
Returns whether the tile needs to be respawned to viewers.
isPaired()  : bool
onBlockDestroyed()  : void
Called when the tile's block is destroyed.
pairWith()  : bool
readSaveData()  : void
saveNBT()  : CompoundTag
setDirty()  : void
setName()  : void
unpair()  : bool
addAdditionalSpawnData()  : void
An extension to getSpawnCompound() for further modifying the generic tile NBT.
checkPairing()  : void
loadItems()  : void
loadName()  : void
onBlockDestroyedHook()  : void
saveItems()  : void
saveName()  : void
writeSaveData()  : void
createPair()  : void

Constants

TAG_ID

public mixed TAG_ID = "id"

TAG_PAIR_LEAD

public mixed TAG_PAIR_LEAD = "pairlead"

TAG_PAIRX

public mixed TAG_PAIRX = "pairx"

TAG_PAIRZ

public mixed TAG_PAIRZ = "pairz"

TAG_X

public mixed TAG_X = "x"

TAG_Y

public mixed TAG_Y = "y"

TAG_Z

public mixed TAG_Z = "z"

Properties

$closed

public bool $closed = false

$pairX

private int|null $pairX

$pairZ

private int|null $pairZ

$spawnCompoundCache

private CacheableNbt|null $spawnCompoundCache = null
Tags
phpstan-var

CacheableNbt<\pocketmine\nbt\tag\CompoundTag>|null

Methods

__destruct()

public __destruct() : mixed
Return values
mixed

close()

public close() : void
Return values
void

copyDataFromItem()

public copyDataFromItem(Item $item) : void
Parameters
$item : Item
Tags
see
Tile::copyDataFromItem()
Return values
void

getDefaultName()

public getDefaultName() : string
Return values
string

getName()

public getName() : string
Return values
string

getSerializedSpawnCompound()

Returns encoded NBT (varint, little-endian) used to spawn this tile to clients. Uses cache where possible, populates cache if it is null.

public final getSerializedSpawnCompound() : CacheableNbt
Tags
phpstan-return

CacheableNbt<\pocketmine\nbt\tag\CompoundTag>

Return values
CacheableNbt

isClosed()

public isClosed() : bool
Return values
bool

isDirty()

Returns whether the tile needs to be respawned to viewers.

public isDirty() : bool
Return values
bool

isPaired()

public isPaired() : bool
Return values
bool

onBlockDestroyed()

Called when the tile's block is destroyed.

public final onBlockDestroyed() : void
Return values
void

pairWith()

public pairWith(Chest $tile) : bool
Parameters
$tile : Chest
Return values
bool

setDirty()

public setDirty([bool $dirty = true ]) : void
Parameters
$dirty : bool = true
Return values
void

setName()

public setName(string $name) : void
Parameters
$name : string
Return values
void

unpair()

public unpair() : bool
Return values
bool

addAdditionalSpawnData()

An extension to getSpawnCompound() for further modifying the generic tile NBT.

protected addAdditionalSpawnData(CompoundTag $nbt) : void
Parameters
$nbt : CompoundTag
Return values
void

checkPairing()

protected checkPairing() : void
Return values
void

onBlockDestroyedHook()

protected onBlockDestroyedHook() : void
Return values
void

createPair()

private createPair(Chest $tile) : void
Parameters
$tile : Chest
Return values
void

Search results