-
Bug
-
Resolution: Fixed
-
Minecraft 18w50a
-
None
-
Confirmed
The bug
/data modify can create the following corrupt NBT lists:
- List that contains values of differing types (this can crash the game and corrupt the save)
- Empty list that only accepts values of a certain type
How to reproduce (1)
- Create a list in an NBT-safe place (item tag tag).
/setblock ~ ~ ~ chest{Items:[{id:tnt,Count:1b,tag:{custom_list:[1,2,3]}}]}
- Replace a value with one of a differing type.
/data modify block ~ ~ ~ Items[0].tag.custom_list[0] set value 5b
- The list now contains values of differing types, which is otherwise impossible. The game will use the original type for determining what can be appended to the list until the game saves, after which it will use the type of the first item.
- Save your game and reopen it.
→ Loading the corrupt invalid list crashes the game: crash.txt.
How to reproduce (2)
- Create a list in an NBT-safe place (item tag tag).
/setblock ~ ~ ~ chest{Items:[{id:tnt,Count:1b,tag:{custom_list:[1]}}]}
- Remove the only item.
/data remove block ~ ~ ~ Items[0].tag.custom_list[0]
- The list is now empty, but is in an invalid state. Empty lists should be able to accept any value, but this list will only be able to accept values of the original type.
/data modify block ~ ~ ~ Items[0].tag.custom_list append value "string"
→ This command will fail until the game autosaves. When the game saves, this invalid state is corrected.