-
Notifications
You must be signed in to change notification settings - Fork 0
pdc
github-actions[bot] edited this page Jan 17, 2026
·
2 revisions
WARNING: Read migration notes carefully before upgrading.
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
Previous versions serialized arbitrary objects using Base64 encoding and stored them as STRING values.
This implementation no longer uses Base64.
Arbitrary objects are now:
- Serialized directly using
BukkitObjectOutputStream - Stored natively as
PersistentDataType.BYTE_ARRAY
This is a storage-format change only.
Arbitrary object support remains fully supported.
- Existing Base64-encoded PDC values are not compatible
- Stored data must be migrated or deleted
Scripts do not require syntax changes, but values written by older versions will not deserialize correctly.
- 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 - When omitted:
→ Values are serialized and stored asBYTE_ARRAY
- Allows creation of
NamespacedKeyfrom strings such as:plugin:key
- Runtime validation ensures correct types for:
- Key
- Container
- PersistentDataType
- 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
- Lower overhead
- No string encoding or decoding
- Direct compatibility with Bukkit PDC APIs
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 - Deleting a key or setting its value to
nullremoves the entry
- Deserialization failures will propagate runtime errors
- Class definition changes may break previously serialized data
- Old Base64-encoded values must be migrated manually