Skip to content

PDC

PDC means Bukkit PersistentDataContainer. CoreLib uses it to store structured module state on items, block states, and other persistent holders. EmakiCooking now prefers block-entity PDC for station state and falls back to data/stations/ YAML only for non-TileState station anchors.

Why PDC matters

Lore is display text, not reliable data. PDC is more suitable for real state such as item IDs, strengthening stars, forge quality, gem sockets, set pieces, skill IDs, and attribute payloads.

Namespace rule

Each module should write its own namespace or source and avoid overwriting other module data. For example, Gem should not clear Strengthen data, and Strengthen should not clear Forge data.

Advice

Do not manually edit PDC in production. Use module commands or APIs to inspect, clear, or refresh state.

Where shared PDC contracts live now

CoreLib used to host some cross-module PDC contracts. Those contracts have been moved to the owning API / protocol modules. New code should use the right-hand column:

DataAuthoritative entry pointLegacy CoreLib entry point
Equipment attribute PDC contractEmakiAttributeApi (in the EmakiAttributeApi module)PdcAttributeGateway, EmakiAttributeBridge — both @Deprecated(forRemoval = true)
Equipment skill PDC read/writeEquipmentSkillPdcCodec (in the EmakiSkillsProtocol module)SkillPdcGateway@Deprecated(since = "4.5.21", forRemoval = true), delegates only

The CoreLib-side classes are kept as a compatibility surface for one synchronized release window and will be removed afterwards. Do not reference them from new code.

When you store structured data, keep a version number so you can migrate later. CoreLib's SnapshotCodec provides encoding, decoding, and version compatibility support.