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
| Name | Type | Optional | Description |
|---|---|---|---|
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
| Name | Type | Description |
|---|---|---|
exec |
exec | Continues after the operation. |
value |
any | Retrieved value (GET only). |
has |
boolean | True if the key exists. |
Properties
| Key | Type | Default | Description |
|---|---|---|---|
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.
- Spawn Entity → entity → Entity Persistent Data
- Set op=SET, key=boss_type, value="dragon_boss"
Check if an entity is a custom mob
Read a PDC tag on entity death.
- Entity Death Trigger → entity → Entity Persistent Data
- Set op=HAS, key=boss_type
- Entity Persistent Data → has → Branch