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

SNBT output type can generate invalid SNBT arrays (containing more than 1 data type) #552

Open
DorkOrc opened this issue Jun 27, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@DorkOrc
Copy link

DorkOrc commented Jun 27, 2024

For example, this item modifer outputs:

{
  function: "minecraft:set_name",
  name: [
    {
      text: "Hello"
    },
    " World"
  ]
}

Which is invalid SNBT because arrays can only contain elements of the same type, but this contains a compound and a string.

In this specific case, the plain string, " World", should be changed to the compound {text:" World"} as that's how the game naturally would handle it.

This seems like something that would need case-by-case solving. You could always just have a little warning sign if it does happen somewhere that isn't solved saying "Warning this isn't actually valid SNBT!".

@DorkOrc
Copy link
Author

DorkOrc commented Jun 27, 2024

Other examples include places where you can have lists of text components, or other objects and plain text lines. Examples:

@misode misode added the bug Something isn't working label Jun 27, 2024
@misode misode assigned misode and unassigned misode Sep 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants