ข้ามไปที่เนื้อหา

Minecraft Animated Texture Resource Pack Guide (26.3)

Make a Minecraft animated texture resource pack: write a .mcmeta animation file, and switch item models by condition for state-based animation.

อัปเดต 5 พ.ย. 2569เขียนสำหรับ Minecraft 26.3อ่าน 3 นาที

Written for Minecraft 26.3.

A Minecraft animated texture resource pack uses two techniques. A .mcmeta file plays frames of one texture on a loop. An item definition swaps between models when something happens, such as the player using the item.

Before you start

  • A working pack with at least one custom item. See the custom items guide.

  • A texture made of square frames stacked from top to bottom in one PNG.

  • All frames must be the same size.

Loop frames with a .mcmeta file

  1. Stack your frames into one tall PNG. Four 16 by 16 frames make a 16 by 64 image.

  2. Save it, for example as assets/myserver/textures/item/ruby_wand.png.

  3. Next to it, create ruby_wand.png.mcmeta. The name is the full texture file name plus .mcmeta.

{
  "animation": {
    "interpolate": true,
    "width": 16,
    "height": 16,
    "frametime": 2,
    "frames": [
      0,
      1,
      { "index": 2, "time": 10 },
      3
    ]
  }
}
  • frametime is how many ticks each frame lasts by default. The default is 1. A tick is a twentieth of a second.

  • frames sets the order. Entries are frame numbers starting at 0, or objects with an index and a time that overrides frametime. Leave it out to play every frame once, in order.

  • interpolate blends between frames when frametime is above 1. It is off by default.

  • width and height are the size of one frame in pixels.

The smallest valid file is { "animation": {} }, which plays every frame for one tick each.

Block textures work the same way. Put them in assets/<namespace>/textures/block/ with a matching .mcmeta.

Switch models by state

For animation tied to what the player does, use an item definition that picks a model. A minecraft:condition picks one of two. With minecraft:using_item, the first is shown while the player is using the item:

{
  "model": {
    "type": "minecraft:condition",
    "property": "minecraft:using_item",
    "on_true": { "type": "minecraft:model", "model": "myserver:item/wand_active" },
    "on_false": { "type": "minecraft:model", "model": "myserver:item/wand" }
  }
}

For several stages, use minecraft:range_dispatch with minecraft:use_duration. It picks the last entry whose threshold is less than or equal to the number of ticks the item has been used:

{
  "model": {
    "type": "minecraft:range_dispatch",
    "property": "minecraft:use_duration",
    "entries": [
      { "threshold": 0.0, "model": { "type": "minecraft:model", "model": "myserver:item/wand_0" } },
      { "threshold": 20.0, "model": { "type": "minecraft:model", "model": "myserver:item/wand_1" } }
    ],
    "fallback": { "type": "minecraft:model", "model": "myserver:item/wand_0" }
  }
}

Both only react while the player is using the item, so choose a base item that can be used, such as a bow or food.

Frame sizes must match. If the image height is not a multiple of the frame height, the game shows the missing texture.

Check it worked

  1. Reload with F3 + T.

  2. Hold the item. A looping texture should animate in the hand and inventory.

  3. Use the item. A state switch should change the model when the condition becomes true.

Common problems

The texture is stretched or shows as missing

The image dimensions do not divide by width and height.

It does not animate

The .mcmeta name does not match the PNG exactly, or the JSON is invalid. See fixing a pack that is not working.

It animates too fast

The default is one tick per frame. Raise frametime.

A model switch never fires

Check the property name and that the item can actually be used. For tinted variants, see the dyeable items guide.

เข้าร่วม Discord ของเรา

รับความช่วยเหลือเกี่ยวกับสินค้าที่ซื้อ ดูว่าเรากำลังสร้างอะไรต่อ และพูดคุยกับเจ้าของเซิร์ฟเวอร์คนอื่น ๆ