Customizable Player Models (Fabric)

Customizable Player Models (Fabric)

287k Downloads

Paraglider compatibility

EuBruno1 opened this issue ยท 1 comments

commented

Hi, first I would like to thank you for this awesome mod. Second I would like to develop a compatibility for the paraglider mod, is it possible to add a custom animation when holding an item and in the air?
Or, how should I find out how to create this custom animations?
Thanks.

commented

You can use the CPM API to play any command controller animation.
https://github.com/tom5454/CustomPlayerModels/wiki/API-documentation#play-animation-060
So you would write something like this:

public void updateAnimationState(boolean state) {
	api.playAnimation("paraglider:glide", state ? 1 : 0);
}

And you would call it when the gliding state changes.
Then the users will have to create a toggle layer animation with the name paraglider:glide and enable the command controlled option.
This only needs to be called on the client side for the player using the glider.
This is technically just a toggle layer animation that's automatically toggled using the API.