Most (all from what I've seen, but there may be exceptions) items that allow player input for naming, etc. store their data as stringified JSON objects - "{\"text\":\"My Cool Sword\",\"color\":\"red\",\"italic\":true}". This makes it impossible to
- Leverage full customization without commands
- Edit any existing name/lore without completely overwriting the existing name/lore
It's also extremely messy to try to work with in the first place. From what I've seen so far, item names, item lore, signs and books all use the same stringified JSON format, but how they're stored isn't standardized either - Signs have four separate values (Text4, Text3, Text2, Text1 (in that order according to /data get)) and books store an array of pages where each line is just given a line break.
For the sake of command blocks/datapacks/etc, creating an NBT data structure a la enchants, items, etc. that has the same values as the existing JSON objects would drastically improve functionality.
Want to change the color of the text? Just modify tag.display.Name.color
Update the item's description? tag.display.Lore[0].text
Making an adventure map and want the text in a book to be unreadable until they reach certain points in the map? Just change Book.tag.pages[X].obfuscated as they progress through checkpoints.
Please sign in to leave a comment.
0 Comments