Skip to content

Player Emotes

iam edited this page Dec 14, 2022 · 1 revision

A full example of the steps described below can be found here

Generating Animations

Creating .animation file

Create animations for this model. The model can be opened with blockbench. Once the animations are created, you can export them from blockbench as a .animation file.

Extending EmotePlayer

Start by creating a class that extends EmotePlayer.

public class EmoteExample extends EmotePlayer {
}

Registering animations

Map<String, JsonObject> ANIMATIONS = ModelLoader.parseAnimations(ANIMATION_STRING);

The parseAnimations utility can be used to get a map containing the animation name and animation data. Pass this object to the loadEmotes method

public EmoteExample(Instance instance, Pos pos, PlayerSkin skin) {  
	super(instance, pos, skin);  
	loadEmotes(ANIMATIONS);  
}

Playing emotes

getAnimationHandler().playRepeat("dab");

You can get the animation handler and play emotes the same way emotes can be played for normal models.