{"id":18991253,"url":"https://github.com/mt-mods/playerfactions","last_synced_at":"2025-10-06T08:21:10.652Z","repository":{"id":45326146,"uuid":"226845007","full_name":"mt-mods/playerfactions","owner":"mt-mods","description":null,"archived":false,"fork":false,"pushed_at":"2024-12-31T18:45:11.000Z","size":170,"stargazers_count":3,"open_issues_count":2,"forks_count":4,"subscribers_count":8,"default_branch":"master","last_synced_at":"2025-05-31T15:12:42.404Z","etag":null,"topics":["luanti-mod","minetest-mod"],"latest_commit_sha":null,"homepage":"","language":"Lua","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mt-mods.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","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,"zenodo":null}},"created_at":"2019-12-09T10:28:37.000Z","updated_at":"2025-05-16T02:47:46.000Z","dependencies_parsed_at":"2025-04-16T18:11:08.950Z","dependency_job_id":"fa2cbcf3-88fa-461f-a15c-eaca9b538415","html_url":"https://github.com/mt-mods/playerfactions","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/mt-mods/playerfactions","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mt-mods%2Fplayerfactions","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mt-mods%2Fplayerfactions/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mt-mods%2Fplayerfactions/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mt-mods%2Fplayerfactions/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mt-mods","download_url":"https://codeload.github.com/mt-mods/playerfactions/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mt-mods%2Fplayerfactions/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":273244305,"owners_count":25070958,"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","status":"online","status_checked_at":"2025-09-02T02:00:09.530Z","response_time":77,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["luanti-mod","minetest-mod"],"created_at":"2024-11-08T17:13:15.815Z","updated_at":"2025-10-06T08:21:05.619Z","avatar_url":"https://github.com/mt-mods.png","language":"Lua","funding_links":[],"categories":[],"sub_categories":[],"readme":"# playerfactions\n\nA simple mod which allows player created factions. Not very useful on its own, it becomes very powerful when combined with other mods.\n\n## Usage\nWe can choose a mode : single or multi factions.\nBy default players can only be in one faction at a time. If you want to allow players to join multiple factions at once, add `player_factions.mode_unique_faction = false` to minetest.conf\n\nParameters marked with square brackets ([]) are optional; most of these are only used if mode_unique_faction is false.\n\nThere is an admin privs to enable every functions for every faction : playerfactions_admin\n\n\nThese commands can be used by anyone:\n\n- `/factions create \u003cfaction\u003e \u003cpassword\u003e`: Create a new faction\n- `/factions list`: List available factions\n- `/factions info \u003cfaction\u003e`: See information on a faction. For faction with lot of member we can choose the length of the member's list that's going to be shown by adding `player_factions.max_members_list = int` to minetest.conf, default is 50.\n- `/factions player_info \u003cplayer\u003e` See information on a player : joined, owned and administered factions.\n- `/factions join \u003cfaction\u003e \u003cpassword\u003e`: Join an existing faction\n- `/factions leave [faction]`: Leave your faction\n\nThese commands can only be used by faction owners and players with the playerfactions_admin privilege:\n\n- `/factions kick \u003cplayer\u003e [faction]`: Kick someone from your faction\n- `/factions disband \u003cpassword\u003e [faction]`: Disband your faction\n- `/factions passwd \u003cpassword\u003e [faction]`: Change your faction's password\n- `/factions chown \u003cplayer\u003e \u003cpassword\u003e [faction]`: Transfer ownership of your faction\n\nThis command can only be used by players with the playerfactions_admin privilege:\n- `/factions invite \u003cplayer\u003e \u003cfaction\u003e`: Add player to a faction\n\n\n## Translations\n\nIf you know English and another language, please submit a translation! It would be greatly appreciated, and your name will be added to the acknowledgements at the bottom of this page. Thanks!\n\n## Mod integration\n\nThe following mods have optional support for `playerfactions`:\n\n- `areas`: Protect faction territory using areas. [link](https://github.com/minetest-mods/areas)\n- `protector`: Allow faction to be added as a member to protection blocks. [link](https://notabug.org/TenPlus1/protector)\n\n### Using `playerfactions` in your own mod\n\nI strongly recommend reading through the `init.lua` file; the functions at the top give you a pretty good idea of how to use it, but just in case you're short on time I'll list the most important functions below.\n\n- `factions.version` is a variable made to check the version of the playerfactions mod to assert compatibility:  \n* factions.version == nil for firsts version of playerfactions mod\n* factions.version == 2 is the first time this variable is added, with adding multi-faction mode\n- `player_is_in_faction(fname, player_name)`: `true` if the player is in the faction, `nil` in other cases (faction or player doesn't exists or player is not a member of the faction)\n- `get_facts()`: Get a copied table with all data. The structure is :\n```\n{[\"name_of_faction1\"]={\n      [\"owner\"]=name_of_the_owner,\n      [\"members\"]={[\"name_of_a_member1\"]=true, [\"name_of_a_member2\"]=true}\n  }}\n```\n- `get_player_faction(player)`: Get a string with the faction a player belongs to, `nil` if they haven't joined a faction. In multi-faction mode, it will return the oldest created faction which player is into. (it's not necessarily the one they joined first. It checks the facts variable from the top)\n- `get_player_factions(player)`: Get a table with the faction(s) a player belongs to, `nil` if they haven't joined a faction. The structure is: {name_of_faction1, name_of_faction2}\n- `get_owned_factions(player)`: Get a table with the faction(s) owned by a player, `nil` if they have the ownership of no faction. The structure is: {name_of_faction1, name_of_faction2}\n- `get_owner(faction)`: Get the owner of a faction\n- `chown(fname, owner)`: Change the owner of a faction\n- `register_faction(faction, player, password)`: Create a new faction\n- `disband_faction(faction)`: Disband a faction\n- `get_password(faction)`: Gets a faction's password\n- `set_password(faction, password)`: Sets a faction's password\n- `join_faction(faction, player)`: Sets the given player as belonging to this faction\n- `leave_faction(faction, player)`: Remove the given player from the specified faction\n\nNote that all of these functions have sanity checks : if faction or player does not exists, it return false. If operation succeed, it return true or the needed value.\n\n## Acknowledgements\n\nMulti-faction mode and various other improvements added by [Kalio_42](https://git.leagueh.xyz/Kalio_42).\n\nThis mod is loosely based off of the (unmaintained) [factions mod made by Jonjeg](https://github.com/Jonjeg/factions).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmt-mods%2Fplayerfactions","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmt-mods%2Fplayerfactions","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmt-mods%2Fplayerfactions/lists"}