Custom Spawn Data
Folder: Configs/CustomSpawnData/ (.yml files)
Custom Spawn Data lets you attach a named set of extra values to something you spawn or give a player — useful for stamping custom data onto an item (for compatibility with other item mods), or for tracking a condition on the player themselves.
Referenced by name from:
- The
GiveItemWithData,SpawnWithData,SpawnXYZWithData, andSetPlayerDatacommands. - The
PlayerHasAllCustomDataKeys/PlayerHasOneOfCustomDataKeysconditions.
Example
Configs/CustomSpawnData/blessed_sword.yml:
Ints:
crafterID: 12345
Floats:
bonusDamage: 25.0
Strings:
loreText: "Forged in the ashes of the Bonemass"
Used from a dialogue reply:
Text: Take the blessed sword | Command: GiveItemWithData, SwordIron, 1, 3, blessed_sword
Format
One file = one named data set. The file name (without .yml) is the name you reference elsewhere — blessed_sword.yml is referenced as blessed_sword.
Inside the file, group your values by type — all five groups are optional, include only what you need:
Ints:
someKey: 5
Floats:
someKey: 1.5
Longs:
someKey: 100000
Strings:
someKey: "hello"
Bools:
someKey: true
The key names (someKey above) are entirely up to you — invent whatever makes sense for what you are tagging.
Practical notes
- If one file has a formatting mistake, it can block every other Custom Spawn Data set from updating until it is fixed — double-check indentation and quoting carefully in this format, since small YAML mistakes are easy to make.
- There is no built-in meaning to any of these values — they only matter if something reads them back.
PlayerHasAllCustomDataKeysreads them back against the player, and other item mods may read matching values off an item if you use the same key names they expect.
Related
- Commands, Conditions.
- Dialogues.
- Tracking player state — worked examples using
SetPlayerDataandPlayerHasAllCustomDataKeystogether, for puzzles and remembered choices.