Zigy's Player Animator API is a library mod that helps you play player animations.
You can play animations from both server and client side. (The mod automatically sends a packet to the client to play animations)
You may also play animations using a server side command.
Use the GitHub wiki to see all the features of the mod and get started.
CurseForge: https://www.curseforge.com/minecraft/mc-mods/playeranimatorapi
Modrinth: https://modrinth.com/mod/playeranimatorapi