Skip to content

Texture Animator

SashaKYotoz edited this page Aug 5, 2026 · 1 revision

AniTexLibRegs.TEXTURE_ANIMATOR

TextureAnimator


Main class to register ResourceLocation sequence animation.


void register(ResourceLocation location, int amountOfFrames, int animationInterval, boolean isRepeatable)

Registers a manually declared ResourceLocation sequence animation.

This method is required only to manually register animation, TextureJsonCollector collects all of the json files in data/ani_textures directory automatically.

void read(JsonObject json)

Registers a ResourceLocation sequence animation from a provided json file.

This method is automatically called by TextureJsonCollector.

AniTextures Json Format

{
  "location": "modid:textures/particle/wave_like/wave_0.png",
  "amount_of_frames" : 6,
  "animation_interval" : 3,
  "is_repeatable" : true
}
  • "location": the direct location to the first texture that will start the sequence, all of the textures should be located in the same directory
  • "amount_of_frames": the exact number of frames you want to form sequence of
  • "animation_interval": the number of ticks that animator waits to switch between frames
  • "is_repeatable": an optional field to declare the stop of animation when animation reached the end of the sequence