-
Notifications
You must be signed in to change notification settings - Fork 0
pdc
github-actions[bot] edited this page Feb 5, 2026
·
3 revisions
This document describes a set of Skript expressions and helpers for interacting with Bukkit's PersistentDataContainer (PDC).
It supports:
- Native
PersistentDataType(PDT) values - Arbitrary object storage via Java serialization into
BYTE_ARRAY
- Paper server
- Skript
- skript-reflect
- Read, write, and delete PDC entries using a single expression
- Automatically resolves:
-
PersistentDataHolder→PersistentDataContainer
-
- When a
PersistentDataTypeis provided: → Values are stored natively using that PDT - When omitted:
→ Values are serialized and stored as
PersistentDataType.BYTE_ARRAY
There is no standalone NamespacedKey expression.
Instead, namespaced keys are handled directly by the main expression using string input.
Key strings must be in the form:
namespace:key
Example:
"minecraft:foo"
"myplugin:data"
-
Runtime validation ensures correct types for:
- Key string
- Container / holder
- PersistentDataType (if provided)
-
Invalid expressions fail silently to avoid hard Skript errors
- Arbitrary objects are serialized using
BukkitObjectOutputStream - Data is stored directly as
byte[]viaPersistentDataType.BYTE_ARRAY - Objects must implement
java.io.Serializable
expression [devdinc] [namespaced]( |-)key %string% [with]in %pdcholder/pdc% [for %-pdt%]
set {_value} to key "plugin:test" within player's pdc
set {_value} to key "plugin:test" in player's pdc for pdt string
set key "plugin:test" within player's pdc to {_object}
set key "plugin:test" in player's pdc for pdt integer to 5
delete key "plugin:test" within player's pdc
- If no
PersistentDataTypeis specified,BYTE_ARRAYstorage is used - Setting a key to
nullremoves the entry - Deleting a key removes it regardless of storage type
- Deserialization failures will propagate runtime errors
- Class definition changes may break previously serialized data
- Stored objects must remain compatible with Java serialization