Entity paper/entity_pdc

Entity Persistent Data

Reads or writes custom persistent data stored on an entity (survives server restarts).

Note: Entity PDC is mutated in-place — no new entity is returned. Data persists across restarts as long as the entity exists. Keys use the "pnode" namespace automatically.

Inputs

NameTypeOptionalDescription
exec exec Incoming execution.
entity entity The entity to read or write data on.
key string Data key (stored under the "pnode" namespace).
value any Value to store (SET only).

Outputs

NameTypeDescription
exec exec Continues after the operation.
value any Retrieved value (GET only).
has boolean True if the key exists.

Properties

KeyTypeDefaultDescription
op string "GET" GET, SET, HAS, or REMOVE.
key string "my_key" Key
type string "STRING" STRING, INTEGER, DOUBLE, or BOOLEAN.

Examples

Tag a custom mob

Mark a spawned entity as a boss mob using PDC.

  1. Spawn Entity → entity → Entity Persistent Data
  2. Set op=SET, key=boss_type, value="dragon_boss"

Check if an entity is a custom mob

Read a PDC tag on entity death.

  1. Entity Death Trigger → entity → Entity Persistent Data
  2. Set op=HAS, key=boss_type
  3. Entity Persistent Data → has → Branch