{"id":17014918,"url":"https://github.com/kosmx/minecraftplayeranimator","last_synced_at":"2025-04-05T20:03:44.810Z","repository":{"id":38745086,"uuid":"505179610","full_name":"KosmX/minecraftPlayerAnimator","owner":"KosmX","description":"Minecraft 1.16+ player animation library","archived":false,"fork":false,"pushed_at":"2025-03-26T18:04:33.000Z","size":1252,"stargazers_count":97,"open_issues_count":22,"forks_count":23,"subscribers_count":6,"default_branch":"1.21","last_synced_at":"2025-03-29T19:01:36.771Z","etag":null,"topics":["architectury","fabric","forge","minecraft","minecraft-library"],"latest_commit_sha":null,"homepage":"https://modrinth.com/mod/playeranimator","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/KosmX.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-06-19T17:45:03.000Z","updated_at":"2025-03-28T07:51:53.000Z","dependencies_parsed_at":"2023-12-28T21:51:41.423Z","dependency_job_id":"bf79d92e-cb54-4a93-b42f-ff5da8a47db9","html_url":"https://github.com/KosmX/minecraftPlayerAnimator","commit_stats":{"total_commits":188,"total_committers":7,"mean_commits":"26.857142857142858","dds":0.0957446808510638,"last_synced_commit":"1b820181de473c5f223ed74f3e0f203d422ce0b7"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KosmX%2FminecraftPlayerAnimator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KosmX%2FminecraftPlayerAnimator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KosmX%2FminecraftPlayerAnimator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KosmX%2FminecraftPlayerAnimator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/KosmX","download_url":"https://codeload.github.com/KosmX/minecraftPlayerAnimator/tar.gz/refs/heads/1.21","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247393551,"owners_count":20931811,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["architectury","fabric","forge","minecraft","minecraft-library"],"created_at":"2024-10-14T06:26:37.444Z","updated_at":"2025-04-05T20:03:44.777Z","avatar_url":"https://github.com/KosmX.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# PlayerAnimator\n\nPlayerAnimator is a minecraft library to animate the **player** while trying to break as few mods as possible.    \nIf you want to add new entities, use [Geckolib](https://geckolib.com/#mods)\n\nIf you want to trigger simple animations from the server, you might want to use [Emotecraft's server-side API](https://github.com/KosmX/emotes/tree/dev/emotesAPI/src/main/java/io/github/kosmx/emotes/api/events/server).\n\n## Official projects\n**GitHub project** https://github.com/KosmX/minecraftPlayerAnimator  \n**Modrinth** https://modrinth.com/mod/playeranimator  \n**CurseForge** https://www.curseforge.com/minecraft/mc-mods/playeranimator  \n**KosmX's Maven (for API use)** https://maven.kosmx.dev/dev/kosmx/player-anim/  \n\u003e Avoid downloading the library from other sources!  \n\n\n## Example mods\n[Fabric example](https://github.com/KosmX/fabricPlayerAnimatorExample)  \n[Forge example](https://github.com/KosmX/forgePlayerAnimatorExample)  \n\n\n# Include in your dev environment\nFabric loom (or architectury loom)\n```groovy\nrepositories {\n    (...)\n    maven {\n        name \"KosmX's maven\"\n        url 'https://maven.kosmx.dev/'\n    }\n}\n\ndependencies {\n    (...)\n    \n    //If you don't want to include the library in your jar, remove the include word\n    //You can find the latest version in [](https://maven.kosmx.dev/dev/kosmx/player-anim/player-animation-lib-fabric/)\n    include modImplementation(\"dev.kosmx.player-anim:player-animation-lib-fabric:${project.player_anim}\")\n    \n    //You might want bendy-lib. playerAnimator will wrap it.\n    //include modRuntimeOnly(\"io.github.kosmx.bendy-lib:bendy-lib-fabric:${project.bendylib_version}\")\n}\n\n```\nIf you use [architectury](https://docs.architectury.dev/docs/forge_loom/) setup you can implement `player-animation-lib` package in *common*.  \n\nForgeGradle  \n```groovy\n\nminecraft {\n    (...)\n    runs {\n        client {\n            (...)\n           \n            //You have to set mixin propert if you want to run playerAnimator in development environment.\n            property 'mixin.env.remapRefMap', 'true'\n            property 'mixin.env.refMapRemappingFile', \"${projectDir}/build/createSrgToMcp/output.srg\"\n        }\n        server {\n            (...)\n            //Add this to the server too.\n            property 'mixin.env.remapRefMap', 'true'\n            property 'mixin.env.refMapRemappingFile', \"${projectDir}/build/createSrgToMcp/output.srg\"\n        }\n    }\n}\n\nrepositories {\n    (...)\n    maven {\n        name \"KosmX's maven\"\n        url 'https://maven.kosmx.dev/'\n    }\n}\n\ndependencies {\n    (...)\n    \n    //If you don't want to include the library in your jar, remove the include word\n    implementation fg.deobf(\"dev.kosmx.player-anim:player-animation-lib-forge:${project.player_anim}\")\n    \n    //Bendy-lib also has a Forge version:\n    //runtimeOnly fg.deobf(\"io.github.kosmx.bendy-lib:bendy-lib-forge:${project.bendylib_version}\")\n    \n    //Forge JarJar only works on MC 1.19. Do not use JarJar on older version!\n}\n```\n\n**For more advanced things, you might use `anim-core` package**.  \nIt is a minecraft-independent module, containing the animation format and the layers but not the playing mixins...  \nAlso it is **not** a minecraft mod, do not use `modImplementation` on this.\n\n\n\n# Structure \nThe library has an animation list of currently *played* animations\nHigher priority animations will override others, but can be transparent...  \n\nTo add an animation to the player, use \n```java\nAnimationStack animationStack = PlayerAnimationAccess.getPlayerAnimLayer(clientPlayer);\nanimationStack.addAnimLayer(...);\n```\nI advice using `ModifierLayer` and setting its animation. (this is null-tolerant)\n`ModifierLayer` is an `AnimationContainer` but with modifiers and fade-in/out.\n\nTo play a keyframe animation from `emotecraft` or `geckolib` json, `dev.kosmx.playerAnim.core.data.gson.AnimationJson` will help you load it.  \n`new KeyframeAnimationPlayer(animation)` will play it for you.\n\nTo modify/tweak animations, look into `dev.kosmx.playerAnim.api.layered` package, you might implement your own `IAnimation` or extend/modify an existing class.  \n`ModifierLayer` will let you add modifiers. It is effectively an `AnimationContainer` layer.  \n\nYou might find some usage in the [fabric testmod](https://github.com/KosmX/minecraftPlayerAnimator/blob/dev/minecraft/fabric/src/testmod/java/dev/kosmx/animatorTestmod/PlayerAnimTestmod.java)  \nThe forge usage is similar. For most fabric users, you can use [linkie](https://linkie.shedaniel.me/mappings) to translate mojmap to Yarn.  \n\n# Model\nThe player model is made of 6 body parts:  \n- head  \n- torso  \n- right arm  \n- left arm  \n- right leg  \n- left leg\n\nAnd I added an extra: __body__:  \nThis is a bone for the whole player, transforming it will transform every part.  \n*To move everything up by 2, you only need to move the `body` up.*  \n\n\u003e Most Blockbench player models use the name `body` for the part, I call `torso`. In that case, rename it to `torso` and that will fix the model for the library.  \n\nPart names can be `snake_case` or `camelCase`:  \n`right_arm` or `rightArm`, both will work.  \n\nSupported transformations:  \noffset, rotation\n\nAnd bend if bendy-lib is loaded.    \nBend will `bend` the part in the middle, check the `Blender` model to see how.  \n\nThe library supports all easings from [easings.net](https://easings.net/#) and constant and linear.  \nNo easing parameters are supported. (everything was copied from easings.net)  \n\n## Animate\nYou can use GeckoLib or *Emotecraft* format to create animations.  \nBe careful, the model has to match the player or the animation won't work as it should.  \n\nIn Emotecraft repo, there are some [tools](https://github.com/KosmX/emotes/tree/dev/blender) for animation.  \n(You don't need emotecraft to use those tools)  \n\u003e The blockbench model **doesn't** support items, I don't know how to add an easily replaceable item...    \n\n***\n\nTo load an animation, put the file(s) into `assets/modid/player_animation/`  \nThen you can get the animation with `dev.kosmx.playerAnim.minecraftApi.PlayerAnimationRegistry#getAnimation()`\n\n## Notes\nGeckoLib is not guaranteed to work, but you can try! (It will work most of the time)  \n[molang](https://docs.microsoft.com/minecraft/creator/reference/content/molangreference/) is not supported  \n***\nDo **not** shadow the library in your mod, this library can not be loaded multiple times safely. (even from different packages)  \n\u003e The license would allow it, but it would break many things.  \nYou may use `include`(fabric any version) or JarJar(forge 1.19.1+).\n\n\n\n## If you have questions, feel free to ask on Discord:  \nhttps://discord.com/invite/x22jkxRpsD\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkosmx%2Fminecraftplayeranimator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkosmx%2Fminecraftplayeranimator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkosmx%2Fminecraftplayeranimator/lists"}