Nicholas Lamicela
- nupanick
- nupanick
- Europe/Stockholm
- Yes
- No
This function works as intended:
{{title @a
{text: "Hello, World!"}}}
This function does not:
{{title @a {
text: "Hello, World!"
}}}Additionally, the failing function simply throws the error "Unknown function", which is cryptic and unhelpful – it would be much easier to debug problems of this type if there was a different error for "function not found" and "function did not parse correctly."
This function works as intended:
Unable to find source-code formatter for language: mcfunction. Available languages are: actionscript, ada, applescript, bash, c, c#, c++, cpp, css, erlang, go, groovy, haskell, html, java, javascript, js, json, lua, none, nyan, objc, perl, php, python, r, rainbow, ruby, scala, sh, sql, swift, visualbasic, xml, yamltitle @a {text: "Hello, World!"}This function does not:
Unable to find source-code formatter for language: mcfunction. Available languages are: actionscript, ada, applescript, bash, c, c#, c++, cpp, css, erlang, go, groovy, haskell, html, java, javascript, js, json, lua, none, nyan, objc, perl, php, python, r, rainbow, ruby, scala, sh, sql, swift, visualbasic, xml, yamltitle @a { text: "Hello, World!" }Additionally, the failing function simply throws the error "Unknown function", which is cryptic and unhelpful – it would be much easier to debug problems of this type if there was a different error for "function not found" and "function did not parse correctly."
This function works as intended:
Unable to find source-code formatter for language: mcfunction. Available languages are: actionscript, ada, applescript, bash, c, c#, c++, cpp, css, erlang, go, groovy, haskell, html, java, javascript, js, json, lua, none, nyan, objc, perl, php, python, r, rainbow, ruby, scala, sh, sql, swift, visualbasic, xml, yamltitle @a {text: "Hello, World!"}This function does not:
Unable to find source-code formatter for language: mcfunction. Available languages are: actionscript, ada, applescript, bash, c, c#, c++, cpp, css, erlang, go, groovy, haskell, html, java, javascript, js, json, lua, none, nyan, objc, perl, php, python, r, rainbow, ruby, scala, sh, sql, swift, visualbasic, xml, yamltitle @a { text: "Hello, World!" }Additionally, the failing function simply throws the error "Unknown function", which is cryptic and unhelpful – it would be much easier to debug problems of this type if there was a different error for "function not found" and "function did not parse correctly."
The title command will parse this JSON as having a text attribute.
title @a {text: "Hello, World!"}The tellraw command will NOT parse this JSON as having a text attribute. It will not throw any errors, it will just quietly fail to output text.
tellraw @a {text: "Hello, World!}Instead, this workaround is required:
tellraw @a {text: "Hello, World!}The title command will parse this JSON as having a text attribute.
title @a {text: "Hello, World!"}The tellraw command will NOT parse this JSON as having a text attribute. It will not throw any errors, it will just quietly fail to output text.
tellraw @a {text: "Hello, World!}Instead, this workaround is required:
tellraw @a {"text": "Hello, World!}
The title command will parse this JSON as having a text attribute.
title @a {text: "Hello, World!"}The tellraw command will NOT parse this JSON as having a text attribute. It will not throw any errors, it will just quietly fail to output text.
tellraw @a {text: "Hello, World!}Instead, this workaround is required:
tellraw @a {"text":"Hello, World!}The title command will parse this JSON as having a text attribute.
title @a {text: "Hello, World!"}The tellraw command will NOT parse this JSON as having a text attribute. It will not throw any errors, it will just quietly fail to output text.
tellraw @a {text: "Hello, World!"}Instead, this workaround is required:
tellraw @a {"text": "Hello, World!"}
Without the title position argument it just uses the default "title" position.
EDIT: At any rate, I feel like the title command is parsing this more like "normal" JSON, and it's the tellraw one that's being overly picky. Are there multiple inconsistent JSON parsers used on the backend?
EDIT 2: I looked it up and apparently requiring the key to have quotes around it is actually pretty standard. Huh. Well, either way, it would make more sense to use the same parse function for all JSON parsers.
Hrm, that makes it sort of hard to write complex JSON in commands. I guess I could write in some sort of intermediate format and then use a script to remove the line breaks? It would be nice to see support for standard JSON in the future.
This is a cowardly solution to the problem. The community came up with a powerful unexpected use for the sculk sensor, and Mojang said "stop having fun."