-
Bug
-
Resolution: Fixed
-
1.20.5 Release Candidate 2, 1.20.5
-
None
-
Confirmed
-
Data Packs, Items
-
Normal
-
Platform
We can obtain Book and Quill carrying custom data by crafting the following recipe:
We specify a value of 1 for "isNamebook" in the "minecraft:custom_data" component of the item.
Use the following command to get the mainhand item data:
/data get entity @s SelectedItem
We get the following output:
I would expect "isNamebook" to have a value of 1, however it has a value of 1b.
I found that the data is converted as follows:
- true -> 1b
- 1 -> 1b
- 0 -> 0b
- 0.5 -> 0.5f
- 1.2 -> 1.2d
- -2147483648 -> -2147483648
- -2147483649 -> -2147483649L
This follows the same pattern as the wiki description of the conversion of nbt from json files:
NBT_format#Conversion_from_JSON
This means that only 1b can exist in the "minecraft:custom_data" component of a recipe output item, not 1s, 1, 1l, 1.0f, 1.0d.
I've provided the datapack in the attachment (it's the zip)
- is duplicated by
-
MC-271267 Invalid drop chances set to "minecraft:entity_data" component by "set_components"
- Resolved
-
MC-272240 The data type of the "minecraft:custom_data" modifier of the item_modifier will be forcibly modified
- Resolved
- relates to
-
MC-274615 ArmorDropChances and HandDropChances in spawn egg data from loot tables are not converted into lists of floats, causing them to reset when a mob is spawned from the spawn egg
- Resolved