Factions Documentation
Factions is a factions core for Paper and Folia 26.3. It has classic factions gameplay plus raiding, supports SQLite, MySQL, MariaDB and PostgreSQL, and can sync factions across servers with Redis. Every config option can be edited in-game.
Overview
- One jar for Paper and Folia. It only uses the region, entity, global and async schedulers and never the old Bukkit scheduler.
- Every option editable in-game — through a GUI, or from the console with tab completion and validation.
- Four databases, with a built-in SQLite → MySQL/PostgreSQL migration and a FactionsUUID / SaberFactions importer.
- Cross-server sync over Redis for factions, members, claims, banks, chat and alerts.
- Small jar (~380 KB). Paper downloads the database drivers, HikariCP and Jedis from Maven Central on first start.
Requirements
- Paper 26.3 (the plugin declares
api-version: '26.3'andfolia-supported: true) - Java 25
- Optional: Vault (economy), PlaceholderAPI, WorldGuard
- For cross-server sync: a shared MySQL, MariaDB or PostgreSQL database and a Redis server
The plugin is built against Paper 26.3. Folia did not have a 26.3 build when this version was made; because only scheduler APIs that Folia shares with Paper are used, the same jar is meant to run on Folia 26.3 once it ships.
Installation
- Put
Factions-1.0.0.jarin theplugins/folder. - Start the server. On first start Paper downloads the libraries the plugin needs, so the server needs access to Maven Central (through Paper's mirror).
- The default storage is SQLite (
plugins/Factions/factions.db) — nothing to set up. To use a server database, see Databases. - Open
/f admin configin-game to go through the settings.
How It Is Built
- Memory first. Faction, member and claim data lives in memory in thread-safe collections. Protection checks never touch the database.
- No race conditions on Folia. Any change to claims, membership, names or relations is checked a second time and applied under a single lock. A chunk can't end up with two owners, a player can't join two factions, and claims can't exceed power, even when region threads act at the same time.
- Delayed batched saves. Changes are written in one transaction every
general.save-interval-seconds. A failed save is retried at the next interval. Shutdown saves everything before stopping. - Banks can't be duplicated. The money and TNT banks update balances in the database with a single conditional statement. Two withdrawals at the same moment, even from different servers, can't overdraw a bank. Items or money are taken from the player first and given back if the deposit fails.
- Teleports are async. Homes and warps use
teleportAsync.
Tested behaviour
The test suite runs the real services on a temporary SQLite database and covers:
- claim limits and overclaiming
- many threads claiming one chunk
- many members claiming past their power at once
- many players creating the same faction name at once
- ranks and attempts to grant yourself extra permissions
- relations and ally limits
- data surviving a restart
- concurrent bank withdrawals
- config validation
- SQL for each database type
Features
| Area | Features |
|---|---|
| Factions | create, disband (confirmation GUI), rename (cooldown/cost), description, MOTD, open/closed, invites that expire, join cooldown, max members, auto-kick of inactive members |
| Ranks | Leader / Co-Leader / Moderator / Member / Recruit plus custom ranks, a permission matrix per rank, promote/demote/setrank, leader transfer, protection against granting yourself extra permissions |
| Relations | ally / truce / neutral / enemy. Enemy is one-sided; ally and truce need both factions to agree. Ally/truce limits, clickable accept |
| Claims | single, square, circle, fill, auto-claim, auto-unclaim, unclaim all, overclaiming raidable factions (enemy-only and border-only options), buffer zones, connected-claims rule, world allow/block lists, distance from spawn, WorldGuard regions |
| Power | lazy regeneration (online/offline rates), loss on death with multipliers per territory, PvP-only loss, regen freeze after death, player and faction boosts, strike penalty |
| Protection | build/break, containers, doors, buttons, levers, plates, redstone, item frames, armor stands, animals, spawners, buckets, pistons, fluids, dispensers, tree growth, bone meal, fire, mob griefing, trampling, wind charges, projectiles, ender pearl/chorus into enemy land, blocked commands in enemy land |
| PvP | ally/truce friendly-fire rules, SafeZone/WarZone, splash and lingering potions |
| Raiding | explosion rules for wilderness/claims/system zones, toggles per explosion type, daily raid shield window (timezone aware), offline protection, chance to drop spawners, raid alerts, TNT bank, strikes with automatic commands, /f top by value (spawners and blocks) |
| Utility | home, warps (optional passwords), faction/ally/truce chat, cross-server chat, chat spy, relation-colored chat tags, /f fly with enemy check and fall protection, chat map + clickable GUI map, /f near, chunk borders, territory titles, audit log |
| Economy (Vault) | faction bank, costs for every action, refund on unclaim, bank paid to the leader on disband |
| Admin | bypass, config GUI, /f admin config get/set/reset, live message editing, SafeZone/WarZone, power/boost, strikes, inspect, FactionsUUID import, SQLite → MySQL/Postgres migration, SQLite backups |
| API | FactionsApi.get(), events: create, disband, rename, join, leave, claim, unclaim, relation change, power loss |
In-game Configuration
/f admin configopens a GUI with every option grouped by category. Left/right/shift-click changes numbers, toggles and choices. Text and list options are typed in chat. Press Q to reset an option to its default./f admin config set <path> <value>sets an option from the console, with tab completion and validation./f admin lang <key> <minimessage>changes a message and shows a preview.
Changes take effect immediately. Options marked requires restart (database, Redis, command aliases) take effect after a restart.
Configuration
The most important keys and their defaults. Every key can be changed with /f admin config; the full list is in the GUI.
General
| Key | Default | Description |
|---|---|---|
general.server-name | server-1 | Unique name of this server, used for cross-server sync. Requires restart. |
general.save-interval-seconds | 30 | How often changed data is written to the database. Requires restart. |
general.command-aliases | [faction, fac] | Extra aliases for /f. Requires restart. |
general.disabled-worlds | [] | Worlds where factions is fully disabled (no claims, no protection). |
general.language | en | Language file to use from the lang folder. |
Factions and relations
| Key | Default | Description |
|---|---|---|
faction.max-members | 30 | Max members per faction. 0 = unlimited. |
faction.name-min-length / name-max-length | 3 / 16 | Faction name length. |
faction.invite-expire-minutes | 30 | Minutes until an invite expires. |
faction.rename-cooldown-minutes | 60 | Cooldown between renames. |
faction.join-cooldown-minutes | 0 | After leaving a faction, players must wait this long to join another. |
faction.max-warps | 5 | Max warps per faction. |
faction.auto-kick-inactive-days | 0 | Kick members offline longer than this. 0 = never. |
relations.max-allies | 2 | -1 = unlimited, 0 = disables alliances. |
relations.max-truces | 3 | -1 = unlimited, 0 = disables truces. |
Power and claims
| Key | Default | Description |
|---|---|---|
power.player-max / player-min | 10 / -10 | Power range per player. |
power.player-starting | 10 | Power new players start with. |
power.regen-per-minute-online | 0.2 | Power regenerated per minute while online. |
power.regen-per-minute-offline | 0 | Power regenerated per minute while offline. |
power.loss-per-death | 4 | Power lost per death, multiplied by the territory multipliers. |
power.loss-only-on-pvp | false | Only lose power when killed by a player. |
power.per-claim | 1 | Power needed per claimed chunk. 0 = unlimited claims (subject to claims.max-per-faction). |
claims.max-per-faction | 0 | Hard limit of claims per faction. 0 = only limited by power. |
claims.max-radius | 5 | Max radius for /f claim <radius>. |
claims.fill-max | 100 | Max chunks claimed by /f claim fill. 0 disables fill. |
claims.must-be-connected | true | New claims must touch existing claims (except the first). |
claims.buffer-chunks | 0 | Chunks of wilderness required between different factions. |
claims.overclaim-enabled | true | Allow claiming land of raidable factions. |
claims.overclaim-border-only | true | Overclaimed chunks must be on the border of the target territory. |
claims.deny-in-worldguard-regions | true | Deny claims overlapping WorldGuard regions (if installed). |
Raiding
| Key | Default | Description |
|---|---|---|
raid.explosions-in-claims | true | Explosions break blocks in faction territory. |
raid.allow-tnt | true | TNT and TNT minecarts damage claims. |
raid.allow-creeper / allow-wither / allow-fireball | false | Whether these damage claims. |
raid.allow-end-crystal | true | End crystals damage claims. |
raid.offline-explosion-protection | false | Explosions do not damage factions with no online members. |
raid.spawner-drop-chance | 0 | Chance (0–1) that a spawner drops when blown up in a claim. |
raid.shield.enabled | true | Factions can choose a daily raid shield window. |
raid.shield.duration-hours | 10 | Length of the shield window. |
raid.shield.timezone | UTC | Timezone for shield hours (e.g. Europe/Berlin). |
raid.tnt-bank.max | 250000 | Max TNT in a faction bank. 0 = unlimited. |
strikes.max | 5 | Strikes at which strikes.max-commands run. |
Teleport and fly
| Key | Default | Description |
|---|---|---|
teleport.warmup-seconds | 3 | Teleport warmup. Moving or taking damage cancels it. |
teleport.cooldown-seconds | 15 | Teleport cooldown. |
teleport.deny-if-enemy-within | 0 | Deny teleports if an enemy is within this many blocks. 0 = off. |
fly.enabled | true | Enable /f fly. Allowed in own and ally territory by default. |
fly.enemy-disable-radius | 32 | Disable fly if an enemy is this close. 0 = off. |
fly.fall-protection-seconds | 5 | No fall damage after fly is disabled. |
Economy (Vault)
All costs (economy.cost.create, claim, home, sethome, warp, setwarp, rename, join) default to 0. economy.refund.unclaim sets the refund per unclaimed chunk. The faction bank is on by default (economy.bank.enabled) and is paid to the leader on disband.
Databases
Set storage.type to SQLITE (the default), MYSQL, MARIADB or POSTGRESQL, then fill in storage.host, port, database, username and password. All tables use storage.table-prefix (default factions_). SQLite is backed up every 60 minutes and the last 24 backups are kept.
Moving from SQLite to a server database
- Change
storage.*in the config and restart. - Run
/f admin migrate sqlite factions.db.
Importing from FactionsUUID or SaberFactions
Put their data/*.json files into plugins/Factions/data/ and run /f admin import factionsuuid confirm. This replaces all current faction data.
Cross-server Sync (Redis)
- Use the same MySQL/MariaDB/PostgreSQL database on every server.
- Set
sync.enabled: trueandsync.redis-uri(defaultredis://localhost:6379). - Give each server a unique
general.server-name. - World names must be unique across servers, because claims are stored by world name.
Factions, members, claims, banks, chat and alerts are synced. Faction names are reserved in Redis so two servers can't create the same name. If two servers edit the same faction at the same moment, the newer version wins.
Commands
The base command is /f (aliases: /faction, /fac, configurable).
Player commands
help, create, disband, rename, desc, motd, open, show, list, top, power, near, map, seechunk, gui, invite, deinvite, join, leave, kick, promote, demote, setrank, leader, rank, claim, unclaim, autoclaim, ally, truce, neutral, enemy, relations, home, sethome, delhome, warp, setwarp, delwarp, chat, fly, perms, logs, shield, tnt, bank, strikes
Admin commands
/f admin <bypass|chatspy|reload|save|config|lang|disband|join|kick|setleader|setpower|boost|strike|safezone|warzone|unclaim|inspect|value|import|migrate|logs>
Permissions
| Permission | Default | Effect |
|---|---|---|
factions.player | everyone | All player commands |
factions.command.<name> | via factions.player | One subcommand |
factions.command.admin | op | The /f admin commands |
factions.admin | op | All admin commands and bypasses |
factions.bypass.cost | op | Never charged for actions |
factions.bypass.cooldown | op | No teleport cooldown |
factions.bypass.warmup | op | No teleport warmup |
PlaceholderAPI
Player placeholders, used as %factions_<name>%:
name, name_colored, description, motd, leader, rank, power, maxpower, player_power, player_maxpower, land, land_max, members, online, bank, tnt, value, top_rank, strikes, strikes_max, raidable, shield, open, allies, enemies, truces, has_faction, chat_mode, territory, territory_colored
Relational placeholders: %rel_factions_relation%, %rel_factions_relation_color%, %rel_factions_name%.
Developer API
The factions-api module holds the public interfaces. Get the instance with FactionsApi.get().
Events: create, disband, rename, join, leave, claim, unclaim, relation change, power loss.
Getting a Build
Factions is not released. Ask for a build in the Discord server, and tell us your server software, version and Java version. See Projects for the other plugins on the bench.