API reference / @jsprismarine/prismarine / entity/data/DataEntity / DataEntity
Class: DataEntity
Defined in: packages/prismarine/src/entity/data/DataEntity.ts:1404
One live entity in the data-driven runtime.
Constructors
Constructor
new DataEntity(
options):DataEntity
Defined in: packages/prismarine/src/entity/data/DataEntity.ts:1429
Parameters
options
Returns
DataEntity
Properties
body
readonlybody:MobBody
Defined in: packages/prismarine/src/entity/data/DataEntity.ts:1406
Where the entity is, where it is going, and what it is after.
brain
brain:
Brain|undefined
Defined in: packages/prismarine/src/entity/data/DataEntity.ts:1424
The live brain, or undefined for a goal-only entity. A villager's is built again, with its memories, when it takes or loses a profession.
brainMob
readonlybrainMob:BrainMobDefinition|undefined
Defined in: packages/prismarine/src/entity/data/DataEntity.ts:1418
The brain definition, for one of the twenty mobs Bedrock's JSON cannot express.
instance
readonlyinstance:EntityInstance
Defined in: packages/prismarine/src/entity/data/DataEntity.ts:1412
The component state machine, which owns the events, properties and goals.
persistentIdentity
readonlypersistentIdentity:string
Defined in: packages/prismarine/src/entity/data/DataEntity.ts:1409
Stable identity used by persistent relationships such as spawned leash holders.
removed
removed:
string|undefined
Defined in: packages/prismarine/src/entity/data/DataEntity.ts:1427
Why the entity was taken out of the world, or undefined while it is still in it.
spawnData
readonlyspawnData:Readonly<Record<string,unknown>> |undefined
Defined in: packages/prismarine/src/entity/data/DataEntity.ts:1415
Entity-specific fields supplied by the source that spawned it.
Accessors
conditions
Get Signature
get conditions():
Set<string>
Defined in: packages/prismarine/src/entity/data/DataEntity.ts:1455
The boolean facts a brain reads off the body, such as on_ground or aggressive.
Returns
Set<string>
facts
Get Signature
get facts():
EntityFacts
Defined in: packages/prismarine/src/entity/data/DataEntity.ts:1445
The entity's facts as its active components make them now: its box, its stats and its families.
Returns
id
Get Signature
get id():
number
Defined in: packages/prismarine/src/entity/data/DataEntity.ts:1440
The runtime id, unique for the length of the session.
Returns
number
identifier
Get Signature
get identifier():
string
Defined in: packages/prismarine/src/entity/data/DataEntity.ts:1450
The namespaced identifier, such as minecraft:zombie.
Returns
string
position
Get Signature
get position():
EntityPosition
Defined in: packages/prismarine/src/entity/data/DataEntity.ts:1469
Where the entity is now.
Returns
Set Signature
set position(
position):void
Defined in: packages/prismarine/src/entity/data/DataEntity.ts:1473
Parameters
position
Returns
void
runsGoals
Get Signature
get runsGoals():
boolean
Defined in: packages/prismarine/src/entity/data/DataEntity.ts:1485
Whether the entity runs the goal scheduler.
Every entity that is not a brain mob does, and so do the three that run both systems: Camel and HappyGhast carry registerGoals as well as brainProvider in Java, and Tadpole inherits AbstractFish's, which is what alsoRunsGoals records.
Returns
boolean
target
Get Signature
get target():
number|undefined
Defined in: packages/prismarine/src/entity/data/DataEntity.ts:1460
Who the entity is fighting, by runtime id, or undefined when it is fighting nobody.
Returns
number | undefined
Set Signature
set target(
id):void
Defined in: packages/prismarine/src/entity/data/DataEntity.ts:1464
Parameters
id
number | undefined
Returns
void
Methods
step()
step(
options?):void
Defined in: packages/prismarine/src/entity/data/DataEntity.ts:1490
Advances the walk by one tick.
Parameters
options?
Returns
void