Доброго времени суток, подскажите пожалуйста, как вызывать анимацию при определенном действии моба? т.е. если он стоит то одна анимация, если он идет то другая и тд.
Java:
public class EntityTest extends AnimatedEntity
{
protected static AnimationHandler animHandler = CraftStudioApi.getNewAnimationHandler(TileEntityTest.class);
static {
EntityTest.animHandler.addAnim(Mod_Test.MODID, "position", "craftstudio_api_test", true);
}
public EntityTest(World par1World) {
super(par1World);
}
@Override
public AnimationHandler getAnimationHandler() {
return EntityTest.animHandler;
}
@Override
public void onLivingUpdate() {
super.onLivingUpdate();
if (this.isWorldRemote() && !this.getAnimationHandler().isAnimationActive(Mod_Test.MODID, "position", this))
this.getAnimationHandler().startAnimation(Mod_Test.MODID, "position", this);
}
}