Skip to content

API reference / @jsprismarine/prismarine / entity/data/live

entity/data/live ​

Classes ​

Interfaces ​

KeptActorState ​

Defined in: packages/prismarine/src/entity/data/live.ts:204

What an actor record held apart from an entity's record, which a restored entity keeps.

Properties ​

nameTag? ​

readonly optional nameTag?: string

Defined in: packages/prismarine/src/entity/data/live.ts:208

The name tag, for a record that does not name the entity itself.

persistentNbt ​

readonly persistentNbt: NBTTagCompound | null

Defined in: packages/prismarine/src/entity/data/live.ts:206

The actor record tags this server does not model, which the next save writes back.

statusEffects ​

readonly statusEffects: readonly StatusEffect[]

Defined in: packages/prismarine/src/entity/data/live.ts:212

The status effects, which the entity's immunities still filter.

tags ​

readonly tags: readonly string[]

Defined in: packages/prismarine/src/entity/data/live.ts:210

The /tag tags.


LiveEntityOptions ​

Defined in: packages/prismarine/src/entity/data/live.ts:216

What EntityRuntimes.open is given for one dimension.

Properties ​

dimension ​

readonly dimension: string

Defined in: packages/prismarine/src/entity/data/live.ts:218

The namespaced dimension identifier, such as minecraft:overworld.

entities ​

readonly entities: ContentEntityAccess

Defined in: packages/prismarine/src/entity/data/live.ts:235

The live world's own entity group.

Players and item drops come from here rather than from the runtime, because a player is driven by a network session and a dropped stack by the item subsystem. Neither is a component set.

level? ​

readonly optional level?: string

Defined in: packages/prismarine/src/entity/data/live.ts:223

The worlds.<name> level the dimension belongs to, or undefined for the default level, which is the one the content packages address by dimension alone.

world ​

readonly world: EntityWorldFacts

Defined in: packages/prismarine/src/entity/data/live.ts:227

The groups the blocks, world and effects subsystems own, for this dimension.

Methods ​

content() ​

content(): ServerContent

Defined in: packages/prismarine/src/entity/data/live.ts:225

The built content, read at call time; the runtime outlives any one build.

Returns ​

ServerContent

liveWorld() ​

liveWorld(): World | undefined

Defined in: packages/prismarine/src/entity/data/live.ts:237

The live world of this dimension, or undefined when none is loaded.

Returns ​

World | undefined

report() ​

report(message): void

Defined in: packages/prismarine/src/entity/data/live.ts:239

Receives everything the runtime met and could not carry out.

Parameters ​
message ​

string

Returns ​

void

Functions ​

lyingItemsNear() ​

lyingItemsNear(runtime, center, radius): readonly ContentItemEntity[]

Defined in: packages/prismarine/src/entity/data/live.ts:261

The dropped stacks within a pickup radius, from the runtime's index, in ascending runtime id order. Live, so a stack another mob took earlier in the tick has already left it.

Parameters ​

runtime ​

EntityRuntime

center ​

ContentPosition

radius ​

number

Returns ​

readonly ContentItemEntity[]


reportKill() ​

reportKill(world, victim, source, report): void

Defined in: packages/prismarine/src/entity/data/live.ts:399

Tells the players a kill names of it, through their presenters: the player who dealt the blow, and the player who died. A death with no entity behind it, such as a fall, names no one.

Parameters ​

world ​

Pick<World, "viewerOf">

The world both players are in.

victim ​

StoreActor

What died.

source ​

DamageSource

The blow that killed it.

report ​

(message) => void

Where a failed send is logged.

Returns ​

void