Effective Data Container Utils
Helpers for reading and writing Bukkit PersistentDataContainer (PDC) data on items, entities and other PersistentDataHolders.
Beyond thin typed get/set wrappers, it adds conveniences the vanilla API lacks:
reified
get/setContainerValue<T>that infer the PersistentDataType fromT;UUID / entity storage packed into
LONG_ARRAYkeys (single and lists);Base64 serialization of arbitrary
Serializable/Bukkit objects (and item lists);nested containers, and structured Location storage.
Every getter returns null (rather than throwing) when the key is absent or the holder has no meta. Note: mutating an ItemStack's PDC goes through its itemMeta, so the set*(ItemStack, …) overloads return the updated stack — use the returned value.
Functions
Deserializes a Base64 string produced by base64Serialize back to clazz, or null on failure.
Serializes any Bukkit/Serializable object to a URL-safe Base64 string, or null on failure.
Resolves entities from UUIDs packed under key; list entries are null for offline entities.
Resolves an entity stored as its UUID string under key, or null if not stored/offline.
Resolves a single entity from a UUID packed under key, or null if not stored/offline.
Reads a single UUID packed as a 2-element LONG_ARRAY under key, or null.
Reads a list of UUIDs packed as pairs of longs under key, or null.
setContainer for items: opens/creates a nested container at key, mutates it, writes back. Returns the stack.
Opens (or creates) a nested container at key, lets block mutate it, then writes it back. The building block for structured storage like setLocation.