tutorial:blockentity_modify_data
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revision | |||
tutorial:blockentity_modify_data [2025/04/01 12:46] – [Modify BlockEntity data] solidblock | tutorial:blockentity_modify_data [2025/04/01 12:48] (current) – [Some notes about NbtCompound] solidblock | ||
---|---|---|---|
Line 31: | Line 31: | ||
// returns an empty compound when the field does not exist: | // returns an empty compound when the field does not exist: | ||
NbtCompound config = nbt.getCompound(" | NbtCompound config = nbt.getCompound(" | ||
+ | </ | ||
Besides, since 1.21.5, the whole NBT compound and its fields can be decoded directly with [[codec]]s, such as: | Besides, since 1.21.5, the whole NBT compound and its fields can be decoded directly with [[codec]]s, such as: | ||
Line 45: | Line 46: | ||
Optional< | Optional< | ||
</ | </ | ||
+ | |||
+ | Besides, since 1.21.5, lists support mixing elements of different types. In previous versions, mixing elements of different types in a list results in exceptions. | ||
More information about NBT changes, see [[https:// | More information about NBT changes, see [[https:// |
tutorial/blockentity_modify_data.txt · Last modified: 2025/04/01 12:48 by solidblock