Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Throws error on empty path in resource location #302

Open
AmericanBagel opened this issue Nov 11, 2024 · 0 comments
Open

Throws error on empty path in resource location #302

AmericanBagel opened this issue Nov 11, 2024 · 0 comments

Comments

@AmericanBagel
Copy link

Mecha throws an error when a resource location with no path is used, such as the following:
@function foo:bar

data modify storage foo: mydata set value []

This is the error:

ERROR  | mecha  Expected quoted_string or string but got invalid ': mydata set value []'.
       | src/data/foo/functions/bar.mcfunction:1:24
       |      1 |  data modify storage foo: mydata set value []
       |        :                         ^^^^^^^^^^^^^^^^^^^^^

When it's changed to foo:bar, it works just fine. I'm not at all familiar with the codebase, but I did some quick searching. In other contexts, this would throw an error. However, data storage is one of the few cases (next to functions named .mcfunction) which can apparently do this without issue in Minecraft. However, Mecha takes the brigadier resource object, reads that it specifies minecraft:resource_location, and passes it off to AstResourceLocation, which seems to assume a non-empty path.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant