Predicates no longer support unquoted booleans and numbers in blockstates
Steps to reproduce:
- Download the first datapack, broken.zip, which contains a predicate with the following contents:
{ "condition": "minecraft:location_check", "predicate": { "block": { "blocks": [ "minecraft:snow" ], "state": { "layers": 1 } } } } - Note the unquoted 1 in the layers block state.
- Install it into a world in 23w32a.
- Note that the log errors on this file, noting that it is not a json array.
- Download the second file, not_broken.zip, which contains the same file, with the 1 now quoted.
- Replace the previous datapack
- See the error has now disappeared
- This is also the case for predicates containing unquoted booleans.
- This error was not the case in previous versions, which supported unquoted booleans and numbers.
Linked Issues
is duplicated by1
Created Issue:
Predicates no longer support unquoted booleans and numbers in blockstates
Steps to reproduce:
- Download the first datapack, broken.zip, which contains a predicate with the following contents:
{ "condition": "minecraft:location_check", "predicate": { "block": { "blocks": [ "minecraft:snow" ], "state": { "layers": 1 } } } }- Note the unquoted 1 in the layers block state.
- Install it into a world in 23w32a.
- Note that the log errors on this file, noting that it is not a json array.
- Download the second file, not_broken.zip, which contains the same file, with the 1 now quoted.
- Replace the previous datapack
- See the error has now disappeared
- This is also the case for predicates containing unquoted booleans.
- This error was not the case in previous versions, which supported unquoted booleans and numbers.
Added Category: Data Packs
Removed Category: (Unassigned)
Added Mojang Priority:
Important
Added Assignee:
[Mojang] Gegy
Removed Assignee:
[Mojang] Gegy
Added Linked Issues:
is duplicated by
Thank you for your report!
We're actually already tracking this issue in MC-264739, so this ticket is being resolved and linked as a duplicate.
However, that ticket has been resolved as working as intended, which means that this will not be fixed as it is not considered a bug.
Please be sure to use the search feature before creating a ticket to see if the issue has already been reported.
Quick Links:
📓 Bug Tracker Guidelines – 🛠 Community Support – 📧 Mojang Support – ✍️ Feedback and Suggestions – 💬 Mojira Discord
Thank you for this report! This was not originally an intentional change, however after investigation and discussion, we are closing this as intended behaviour. We will be including a note in the release changelog for 1.20.2, as it is of course a breaking change.
To elaborate on motivations: this behaviour previously worked somewhat 'accidentally', but the intended encoding was always to use quoted strings. This is consistent with how block states are encoded in other parts of the game. This is particularly relevant when encoding block states as NBT, as there is no distinction in data between a boolean and byte - which means that knowledge of the block type is required to parse the state (this is not always available).