mojira.dev
MC-127478

Texture metadata parsing fails if animation block is not present

Behavior

When using a texture .mcmeta without an "animation" section, the parsing fails with an error (example below). The JSON is otherwise perfectly valid.

Error

[01:11:08] [Client thread/ERROR]: Unable to parse metadata from minecraft:textures/blocks/glass.png : com.google.gson.JsonSyntaxException: Missing animation, expected to find a JsonObject

Source (glass.png.mcmeta)

{
    "ctm": {
        "ctm_version": 1,
        "type": "CTM",
        "layer": "CUTOUT",
        "textures": [ "blocks/glass_ctm" ],
        "extra": { "connect_inside": true }
    }
}

Expected Behavior

The mcmeta is loaded normally, the animation section is skipped, and the texture just has no animation.

Comments 3

Some data is mandatory, this goes for all advancements, recipes, etc. as well.

That's not how mcmeta files have ever worked...they have multiple sections that are all optional. It depends on the resource what sections it reads and uses. Prior to 1.13 it was entirely valid to leave out the animation section. I would really like to hear from Mojang on this issue because I sincerely doubt it is intended.

Things change, in vanilla, item and block textures only use .mcmeta files for animations, as such it has become a requirement for them to contain an animation.

tterrag

Erik Broes

Unconfirmed

Minecraft 18w11a

Minecraft 18w20a

Retrieved