ajdnikov Dashboard

Factions Documentation

State Unreleased · 1.0.0Platform Paper 26.3 · FoliaJava 25Storage SQLite, MySQL, MariaDB, PostgreSQLNetwork Redis

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' and folia-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

  1. Put Factions-1.0.0.jar in the plugins/ folder.
  2. 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).
  3. The default storage is SQLite (plugins/Factions/factions.db) — nothing to set up. To use a server database, see Databases.
  4. Open /f admin config in-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

AreaFeatures
Factionscreate, disband (confirmation GUI), rename (cooldown/cost), description, MOTD, open/closed, invites that expire, join cooldown, max members, auto-kick of inactive members
RanksLeader / Co-Leader / Moderator / Member / Recruit plus custom ranks, a permission matrix per rank, promote/demote/setrank, leader transfer, protection against granting yourself extra permissions
Relationsally / truce / neutral / enemy. Enemy is one-sided; ally and truce need both factions to agree. Ally/truce limits, clickable accept
Claimssingle, 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
Powerlazy regeneration (online/offline rates), loss on death with multipliers per territory, PvP-only loss, regen freeze after death, player and faction boosts, strike penalty
Protectionbuild/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
PvPally/truce friendly-fire rules, SafeZone/WarZone, splash and lingering potions
Raidingexplosion 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)
Utilityhome, 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
Adminbypass, 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
APIFactionsApi.get(), events: create, disband, rename, join, leave, claim, unclaim, relation change, power loss

In-game Configuration

  • /f admin config opens 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

KeyDefaultDescription
general.server-nameserver-1Unique name of this server, used for cross-server sync. Requires restart.
general.save-interval-seconds30How 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.languageenLanguage file to use from the lang folder.

Factions and relations

KeyDefaultDescription
faction.max-members30Max members per faction. 0 = unlimited.
faction.name-min-length / name-max-length3 / 16Faction name length.
faction.invite-expire-minutes30Minutes until an invite expires.
faction.rename-cooldown-minutes60Cooldown between renames.
faction.join-cooldown-minutes0After leaving a faction, players must wait this long to join another.
faction.max-warps5Max warps per faction.
faction.auto-kick-inactive-days0Kick members offline longer than this. 0 = never.
relations.max-allies2-1 = unlimited, 0 = disables alliances.
relations.max-truces3-1 = unlimited, 0 = disables truces.

Power and claims

KeyDefaultDescription
power.player-max / player-min10 / -10Power range per player.
power.player-starting10Power new players start with.
power.regen-per-minute-online0.2Power regenerated per minute while online.
power.regen-per-minute-offline0Power regenerated per minute while offline.
power.loss-per-death4Power lost per death, multiplied by the territory multipliers.
power.loss-only-on-pvpfalseOnly lose power when killed by a player.
power.per-claim1Power needed per claimed chunk. 0 = unlimited claims (subject to claims.max-per-faction).
claims.max-per-faction0Hard limit of claims per faction. 0 = only limited by power.
claims.max-radius5Max radius for /f claim <radius>.
claims.fill-max100Max chunks claimed by /f claim fill. 0 disables fill.
claims.must-be-connectedtrueNew claims must touch existing claims (except the first).
claims.buffer-chunks0Chunks of wilderness required between different factions.
claims.overclaim-enabledtrueAllow claiming land of raidable factions.
claims.overclaim-border-onlytrueOverclaimed chunks must be on the border of the target territory.
claims.deny-in-worldguard-regionstrueDeny claims overlapping WorldGuard regions (if installed).

Raiding

KeyDefaultDescription
raid.explosions-in-claimstrueExplosions break blocks in faction territory.
raid.allow-tnttrueTNT and TNT minecarts damage claims.
raid.allow-creeper / allow-wither / allow-fireballfalseWhether these damage claims.
raid.allow-end-crystaltrueEnd crystals damage claims.
raid.offline-explosion-protectionfalseExplosions do not damage factions with no online members.
raid.spawner-drop-chance0Chance (0–1) that a spawner drops when blown up in a claim.
raid.shield.enabledtrueFactions can choose a daily raid shield window.
raid.shield.duration-hours10Length of the shield window.
raid.shield.timezoneUTCTimezone for shield hours (e.g. Europe/Berlin).
raid.tnt-bank.max250000Max TNT in a faction bank. 0 = unlimited.
strikes.max5Strikes at which strikes.max-commands run.

Teleport and fly

KeyDefaultDescription
teleport.warmup-seconds3Teleport warmup. Moving or taking damage cancels it.
teleport.cooldown-seconds15Teleport cooldown.
teleport.deny-if-enemy-within0Deny teleports if an enemy is within this many blocks. 0 = off.
fly.enabledtrueEnable /f fly. Allowed in own and ally territory by default.
fly.enemy-disable-radius32Disable fly if an enemy is this close. 0 = off.
fly.fall-protection-seconds5No 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

  1. Change storage.* in the config and restart.
  2. 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)

  1. Use the same MySQL/MariaDB/PostgreSQL database on every server.
  2. Set sync.enabled: true and sync.redis-uri (default redis://localhost:6379).
  3. Give each server a unique general.server-name.
  4. 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

PermissionDefaultEffect
factions.playereveryoneAll player commands
factions.command.<name>via factions.playerOne subcommand
factions.command.adminopThe /f admin commands
factions.adminopAll admin commands and bypasses
factions.bypass.costopNever charged for actions
factions.bypass.cooldownopNo teleport cooldown
factions.bypass.warmupopNo 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.