Skip to content

Animated Textures (Geckolib4)

Tslat edited this page Jun 18, 2024 · 9 revisions

New to GeckoLib4 is the ability to animate the textures that your GeoAnimatable objects use. This includes all GeckoLib object types such as entities, blocks, items, etc.

NOTE: GeckoLib animated textures are currently not compatible with GeckoLib emissive textures.

Usage

GeckoLib automatically handles animated textures for you so long as you have your file set up properly.

To make your texture animated, you set it up the exact same way you do for animated block or item textures in vanilla Minecraft.

Steps

  1. Make a text file in your texture folder (where your animated texture is), and name it .png.mcmeta

E.G:

  • Texture: zombie.png
  • New File: zombie.png.mcmeta
  1. In it, put the following:
{
  "animation": {
    
  }
}

You can set/add additional properties in that animation block to adjust your animation, see the wiki page linked above for more info.

  1. Make your animated texture png. See vanilla examples such as fire or water to see how it is formatted.

That's it! Use that texture for your GeoAnimatable, and it'll be handled automatically.

GeckoLib supports all standard .mcmeta properties in its texture animations.

Common Mistakes

Q) My texture isn't animated at all and just looks stretched out across the whole thing!
A) You forgot to make your .png.mcmeta file, misnamed it, or you put it in the wrong location

Q) My texture is now animated, but it doesn't line up with the model anymore/looks squished/has gaps in it
A) Animated textures must have each frame be square in size. This means that if your texture is normally 64x32 pixels, you'll need to expand it to be 64x64 (for each frame in your animation)

Q) I tried making a glowing animated texture, and it doesn't look right
A) Currently, GeckoLib does not support animating textures that also utilise a Glowmask. In the future this may be possible

Table of Contents

Geckolib 3
Geckolib 4

Hosted By: Cloudsmith

Package repository hosting is graciously provided by Cloudsmith.

Cloudsmith is the only fully hosted, cloud-native, universal package management solution that enables your organization to create, store and share packages in any format, to any place, with total confidence.

Clone this wiki locally