Installation
Install OptimalAFKZone and OptimalLibrary on your Paper or Folia server.
Requirements
Section titled “Requirements”- OptimalLibrary - required. OptimalAFKZone depends on it and will not enable without it. It is a separate, free plugin that provides the shared runtime (text and MiniMessage, menus, storage, scheduling). Install the latest version alongside the plugin.
- Paper or Folia (or a Paper fork). Spigot is not supported.
- Minecraft 1.21.11, 26.1.1, 26.1.2, 26.2 or 26.3. These are the versions OptimalLibrary supports; other versions are not.
- Java 21 for 1.21.11, Java 25 for the 26.x servers. Check with
java -version.
Optional soft dependency:
- PlaceholderAPI - registers the
%optimalafkzone_...%placeholders and resolves%...%placeholders from other plugins inside messages, actions, displays and menus.
Zone rewards and the default shop items use console commands (eco give, lp user ...), so
whatever plugin those commands belong to needs to be installed too. OptimalAFKZone does not hook them
directly, so point the commands at your own plugins.
- Confirm
java -versionreports the right Java for your server version. - Stop the server.
- Drop
OptimalLibrary.jarandOptimalAFKZone.jarintoplugins/. - (Optional) Add
PlaceholderAPI.jar. - Start the server. The plugin generates its files and prints a startup banner.
- Run
/plugins-OptimalLibraryandOptimalAFKZoneshould both be green.
OptimalLibrary downloads its database drivers (SQLite, MySQL, HikariCP) and XSeries through Paper’s library loader on first startup, so the first launch needs internet access and may take a few extra seconds.
Generated files
Section titled “Generated files”plugins/OptimalAFKZone/├─ config.yml # settings, storage, currency, wand, shards, commands, teleport, auto-AFK, shop, sounds├─ messages.yml # every message├─ zones/ # one file per zone (empty until you create one)├─ boosters/│ ├─ shard2x.yml # 2x shards for 1 hour│ └─ shard3x.yml # 3x shards for 30 minutes├─ shops/│ └─ shards.yml # the default shard shop├─ guis/│ ├─ zones.yml # the AFK Zones menu│ └─ confirm.yml # purchase confirmation menu└─ data/ └─ data.db # SQLite player data (do not edit by hand)No zones ship by default. Create them in-game with the wand, see Creating AFK Zones.
boosters/ and shops/ are only extracted when the folder does not exist yet, so a default file you
delete stays deleted. Delete the whole folder to get the defaults back.
Storage
Section titled “Storage”Player data is stored in SQLite at data/data.db by default, or in MySQL when
Settings.Storage.Type is MYSQL (see config.yml).
The tables carry an afkzone_ prefix, so they never collide with other plugins on a shared MySQL
database:
afkzone_players- each player’s shard balance and total AFK timeafkzone_boosters- each player’s active booster (multiplier and expiry)
Balances and AFK time are kept in memory and saved on Settings.Save-Interval (default 300 seconds),
when a player quits, and on server shutdown. Boosters are written the moment they change.
/afkzoneadmin shards on an offline player edits the stored balance directly, so it cannot be
overwritten by a later save.
Continue to Creating AFK Zones, or read the Information overview first.
