API reference / @jsprismarine/prismarine / blockentity/BlockEntities / Barrel
Class: Barrel
Defined in: packages/prismarine/src/blockentity/BlockEntities.ts:56
Extends
Container
Properties
constructor
constructor: typeof
BlockEntity
Defined in: packages/prismarine/src/blockentity/BlockEntity.ts:23
TypeScript types this.constructor as Function. Declaring it as the class itself lets BlockEntity.getId read the static ID the subclass set. Emits nothing.
Inherited from
Container.constructor
position
readonlyposition:Vector3
Defined in: packages/prismarine/src/blockentity/BlockEntity.ts:28
Inherited from
Container.position
ID
readonlystaticID:"Barrel"='Barrel'
Defined in: packages/prismarine/src/blockentity/BlockEntities.ts:57
Vanilla's id string - Chest, Sign, Furnace. Not a namespaced identifier.
Overrides
Container.ID
Methods
canReuseSerialization()
canReuseSerialization():
boolean
Defined in: packages/prismarine/src/blockentity/BlockEntity.ts:53
Whether a caller can safely reuse a previously serialized form of this block entity. Mutable getters and setters disable reuse because their changes cannot be observed here.
Returns
boolean
Inherited from
Container.canReuseSerialization
getCustomName()
getCustomName():
string|null
Defined in: packages/prismarine/src/blockentity/BlockEntities.ts:34
A container's display name, when the player has renamed it in an anvil.
Returns
string | null
Inherited from
Container.getCustomName
getId()
getId():
string
Defined in: packages/prismarine/src/blockentity/BlockEntity.ts:41
Returns
string
Inherited from
Container.getId
getItems()
getItems():
Set<NBTTagCompound>
Defined in: packages/prismarine/src/blockentity/BlockEntities.ts:21
Returns
Set<NBTTagCompound>
Inherited from
Container.getItems
getPosition()
getPosition():
Vector3
Defined in: packages/prismarine/src/blockentity/BlockEntity.ts:45
Returns
Inherited from
Container.getPosition
isEmpty()
isEmpty():
boolean
Defined in: packages/prismarine/src/blockentity/BlockEntities.ts:29
Returns
boolean
Inherited from
Container.isEmpty
isMovable()
isMovable():
boolean
Defined in: packages/prismarine/src/blockentity/BlockEntity.ts:63
Whether a piston may push this. Vanilla stores it on every block entity.
Returns
boolean
Inherited from
Container.isMovable
toNBT()
toNBT():
NBTTagCompound
Defined in: packages/prismarine/src/blockentity/BlockEntity.ts:87
The compound to write back: the untouched remainder, then the fields this class models. Subclasses override, call super.toNBT(), and add theirs to the result.
Returns
Inherited from
Container.toNBT
fromNBT()
staticfromNBT(nbt):Barrel
Defined in: packages/prismarine/src/blockentity/BlockEntities.ts:59
Parameters
nbt
Returns
Barrel