Jump to content

[1.16.5] JsonToNBT Textures


KylM

Recommended Posts

[1.16.5] Hello, when I parse a JSON string to an ItemStack using JsonToNBT#parseTag with JSON seen beneath, the texture of the skull does not get applied. Any way to fix this?

All other attributes / properties are being applied just fine. Here is the JSON I am using:

{
      "id": "player_head",
      "Count": 1,
      "tag": {
        "CustomModelData": 100001,
        "HideFlags": -1,
        "SkullOwner": {
          "Id": [
            1334301174,
            1630424667,
            -1957730237,
            1373073981
          ],
          "Properties": {
            "textures": [
              {
                "Value": "ewogICJ0aW1lc3RhbXAiIDogMTYwMTU4MDc5MjcyMiwKICAicHJvZmlsZUlkIiA6ICJlZDUzZGQ4MTRmOWQ0YTNjYjRlYjY1MWRjYmE3N2U2NiIsCiAgInByb2ZpbGVOYW1lIiA6ICIwMTAwMDExMDAxMDAwMDExIiwKICAic2lnbmF0dXJlUmVxdWlyZWQiIDogdHJ1ZSwKICAidGV4dHVyZXMiIDogewogICAgIlNLSU4iIDogewogICAgICAidXJsIiA6ICJodHRwOi8vdGV4dHVyZXMubWluZWNyYWZ0Lm5ldC90ZXh0dXJlL2FmMzgyMzQ1ZmQ3OWZjNzgzNjFjNjFjOTYyMzBjNjk0YzM0NDc5MzU4YWMwYWU0OWM0ZGI3YTYyNGE1YWZlNTQiCiAgICB9CiAgfQp9"
              }
            ]
          }
        },
        "display": {
          "Name": "{\"italic\":false,\"color\":\"yellow\",\"text\":\"Next \\u003e\"}"
        }
      }
    }

Kind regards,

Kyllian

Link to comment
Share on other sites

Just now, diesieben07 said:

From JSON to ItemStack.

Why are you doing the reverse?

Okay let me explain a bit further: So the idea is you create a gui, it will then store all items from the gui as json and then you can load the exact same gui again. If that makes sense.

As for how I create the ItemStack:

ItemStack item = ItemStack.of(JsonToNBT.parseTag(itemObject.toString()));

with itemObject being a JsonObject (the JSON for example showed in my OP)

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.