Skip to content
This repository has been archived by the owner on Dec 22, 2021. It is now read-only.

Ticks Done

Wyn Price edited this page Aug 1, 2019 · 2 revisions
- ROUGH DRAFT

Ticks Done describes the amount of ticks done for an animation, starting at 0.

For example, given an animation of length 5 ticks, ticksDone = 0 would be the start, ticksDone = 2.5 would be the middle and ticksDone = 5 would be the end.

Ticks Done Counter

You need to have a counter to store the amount of ticks done for an animation. This counter would reset to 0 every time a new animation is played.
Luckily, there is an internal ticksDone storage. Simply call getTicksDone(Entity, float) to retrieve it. This will automatically reset when a new animation starts. Remember - this is optional, if you want to do your own storage of ticksDone, you are perfectly welcome.

for example: this.playAnimationWalking(entity, this.getTicksDone(entity, partialTicks));

Controlling animation speed

To change the animation speed, simply add a multiplier to ticksDone.
for example: this.playAnimationWalking(entity, entity.animationTicks * 3F); would play the animation 3 times faster

Clone this wiki locally