{"id":15060581,"url":"https://github.com/ladysnake/playerabilitylib","last_synced_at":"2026-04-02T15:45:34.730Z","repository":{"id":39915705,"uuid":"230318677","full_name":"Ladysnake/PlayerAbilityLib","owner":"Ladysnake","description":"It's your new pal!","archived":false,"fork":false,"pushed_at":"2024-06-11T07:17:33.000Z","size":280,"stargazers_count":13,"open_issues_count":11,"forks_count":8,"subscribers_count":2,"default_branch":"1.21","last_synced_at":"2024-10-20T01:25:35.861Z","etag":null,"topics":["fabricmc","fabricmc-mod","hacktoberfest","library"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"lgpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Ladysnake.png","metadata":{"files":{"readme":"README.md","changelog":"changelog.md","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":"2019-12-26T19:39:55.000Z","updated_at":"2024-06-11T06:58:19.000Z","dependencies_parsed_at":"2024-06-11T08:01:36.663Z","dependency_job_id":"2d4da6d8-16db-492b-9575-251b3742f368","html_url":"https://github.com/Ladysnake/PlayerAbilityLib","commit_stats":null,"previous_names":[],"tags_count":21,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ladysnake%2FPlayerAbilityLib","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ladysnake%2FPlayerAbilityLib/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ladysnake%2FPlayerAbilityLib/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ladysnake%2FPlayerAbilityLib/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Ladysnake","download_url":"https://codeload.github.com/Ladysnake/PlayerAbilityLib/tar.gz/refs/heads/1.21","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248166925,"owners_count":21058481,"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":["fabricmc","fabricmc-mod","hacktoberfest","library"],"created_at":"2024-09-24T23:00:47.219Z","updated_at":"2026-04-02T15:45:34.674Z","avatar_url":"https://github.com/Ladysnake.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# PlayerAbilityLib\n\n[![Curseforge](https://curse.nikky.moe/api/img/359522?logo)](https://www.curseforge.com/projects/359522) [![](https://jitpack.io/v/Ladysnake/PlayerAbilityLib.svg)](https://jitpack.io/#Ladysnake/PlayerAbilityLib)\n\nA lightweight serverside library to provide compatibility between mods that make use of player abilities.\n\nConflicts arise often when several mods update the same field in `PlayerAbilities`. This library exists so that\nall modifications can be made from a single place, keeping track of what mod enabled what ability.\n\n**Looking for the Elytra Flight equivalent? Try [FallFlyingLib](https://github.com/adriantodt/FallFlyingLib) or [CaelusApi](https://github.com/TheIllusiveC4/Caelus).**\n\n*credits to ~~InsomniaPrincess~~ Chloe Dawn for some of the API design*\n\n## Adding PAL to your project\n\nYou can add the library by inserting the following in your `build.gradle` :\n\n```gradle\nrepositories {\n    maven {\n        name = 'Ladysnake Mods'\n        url = 'https://maven.ladysnake.org/releases'\n        content {\n            includeGroup 'io.github.ladysnake'\n            includeGroupByRegex 'org\\\\.ladysnake.*'\n        }\n    }\n}\n\ndependencies {\n    modImplementation \"io.github.ladysnake:PlayerAbilityLib:${pal_version}\"\n    include \"io.github.ladysnake:PlayerAbilityLib:${pal_version}\"\n}\n```\n\nYou can then add the library version to your `gradle.properties`file:\n\n```properties\n# PlayerAbilityLib\npal_version = 1.x.y\n```\n\nYou can find the current version of PAL in the [releases](https://github.com/Ladysnake/PlayerAbilityLib/releases) tab of the repository on Github.\n\n## Using PAL\n\nYou can find a couple examples in the [Test Mod](https://github.com/Ladysnake/PlayerAbilityLib/tree/master/src/testmod/java/io/github/ladysnake/paltest).\n\n**Note that PAL interfaces can only be accessed serverside, as no synchronization is done on the ability sources.**  \nRead accesses can still be done directly on the `PlayerAbilities` instance, both serverside and clientside.\n\nIf you want to store more complex data, or to synchronize it between server and client,\nyou should take a look at [Cardinal Components API](https://github.com/OnyxStudios/Cardinal-Components-API).\n\n[Item that toggles an ability](https://github.com/Ladysnake/PlayerAbilityLib/blob/master/src/testmod/java/io/github/ladysnake/paltest/AbilityToggleItem.java) :\n```java\npublic static final AbilitySource FLIGHT_CHARM = Pal.getAbilitySource(\"mymod\", \"flight_charm\");  // works like an identifier\n\n@Override\npublic ActionResult use(World world, PlayerEntity user, Hand hand) {\n    if (!world.isClient) {\n        if (FLIGHT_CHARM.grants(user, VanillaAbilities.ALLOW_FLYING)) { // check whether the source is granting the ability\n            FLIGHT_CHARM.revokeFrom(user, VanillaAbilities.ALLOW_FLYING); // if it is, revoke it\n       } else {\n            FLIGHT_CHARM.grantTo(user, VanillaAbilities.ALLOW_FLYING);  // otherwise, grant it\n        }\n    }\n    return ActionResult.SUCCESS;\n}\n```\n\n[Potion that grants an ability](https://github.com/Ladysnake/PlayerAbilityLib/blob/master/src/testmod/java/io/github/ladysnake/paltest/FlightEffect.java) :\n```java\npublic static final AbilitySource FLIGHT_POTION = Pal.getAbilitySource(\"mymod\", \"flight_potion\");\n\n@Override\npublic void onApplied(LivingEntity effected, AbstractEntityAttributeContainer attributes, int amplifier) {\n    if (effected instanceof PlayerEntity) {\n        Pal.grantAbility((PlayerEntity) effected, VanillaAbilities.ALLOW_FLYING, FLIGHT_POTION);\n        // equivalent to: FLIGHT_POTION.grantTo((PlayerEntity) effected, VanillaAbilities.ALLOW_FLYING);\n    }\n}\n\npublic void onRemoved(LivingEntity effected) {\n    if (effected instanceof PlayerEntity) {\n        Pal.revokeAbility((PlayerEntity) effected, VanillaAbilities.ALLOW_FLYING, FLIGHT_POTION);\n        // equivalent to: FLIGHT_POTION.revokeFrom((PlayerEntity) effected, VanillaAbilities.ALLOW_FLYING);\n    }\n}\n```\nNote that the `onRemoved` method needs a mixin to work, as the vanilla `StatusEffect#onRemoved` method does not get a `LivingEntity` parameter.\nYou can find an example of such a mixin [here](https://github.com/Ladysnake/PlayerAbilityLib/blob/master/src/testmod/java/io/github/ladysnake/paltest/mixin/LivingEntityMixin.java)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fladysnake%2Fplayerabilitylib","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fladysnake%2Fplayerabilitylib","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fladysnake%2Fplayerabilitylib/lists"}