Skip to content

API reference / @jsprismarine/prismarine / blockentity/BlockEntities / Sign

Class: Sign ​

Defined in: packages/prismarine/src/blockentity/BlockEntities.ts:170

A sign's text.

Since 1.19.80 vanilla keeps the front and back faces in their own compounds, with the text inside a further SignTextComponent. Older worlds have a flat Text field. Both are read; the newer shape is written, since that is what the client this server targets expects.

Extends ​

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 ​

BlockEntity.constructor


position ​

readonly position: Vector3

Defined in: packages/prismarine/src/blockentity/BlockEntity.ts:28

Inherited from ​

BlockEntity.position


ID ​

readonly static ID: "Sign" = 'Sign'

Defined in: packages/prismarine/src/blockentity/BlockEntities.ts:171

Vanilla's id string - Chest, Sign, Furnace. Not a namespaced identifier.

Overrides ​

BlockEntity.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 ​

BlockEntity.canReuseSerialization


getBackText() ​

getBackText(): string

Defined in: packages/prismarine/src/blockentity/BlockEntities.ts:196

Returns ​

string


getId() ​

getId(): string

Defined in: packages/prismarine/src/blockentity/BlockEntity.ts:41

Returns ​

string

Inherited from ​

BlockEntity.getId


getLines() ​

getLines(): string[]

Defined in: packages/prismarine/src/blockentity/BlockEntities.ts:200

Returns ​

string[]


getPosition() ​

getPosition(): Vector3

Defined in: packages/prismarine/src/blockentity/BlockEntity.ts:45

Returns ​

Vector3

Inherited from ​

BlockEntity.getPosition


getText() ​

getText(): string

Defined in: packages/prismarine/src/blockentity/BlockEntities.ts:192

Returns ​

string


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 ​

BlockEntity.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 ​

NBTTagCompound

Inherited from ​

BlockEntity.toNBT


fromNBT() ​

static fromNBT(nbt): Sign

Defined in: packages/prismarine/src/blockentity/BlockEntities.ts:182

Parameters ​

nbt ​

NBTTagCompound

Returns ​

Sign