A server-side Fabric mod that forces new players to read and accept a set of server rules — presented in a chest GUI powered by the Inventory Menu mod — before they can interact with the world.
- Mod ID:
server-rules - Environment: server-only (clients do not need to install anything)
- Minecraft:
26.1.1 - Fabric Loader:
>=0.19.2· Fabric API:>=0.145.4+26.1.1· Java:>=25 - License: MIT
- Chest GUI on first join with a three-row layout: chat rules, server rules,
gameplay rules, plus Accept and Decline player-head buttons that
run
/rules acceptand/rules declinewhen clicked. - Full interaction lockdown until the rules are accepted: blocked movement,
chat, commands (except the whitelisted rules commands), block breaking,
block placing, block/entity interaction, and item use. Enforced with a
combination of
Slowness 255,Jump Boost 128,Blindness, and Fabric API interaction callbacks. - Accept timeout with a configurable kick message (defaults to 120 seconds).
/rules-viewcommand for already-accepted players to re-read the rules at any time without getting frozen./rules reload [player]admin command that clears stored acceptances and re-opens the GUI on every affected online player immediately.- Generates its own Inventory Menu datapack into
<world>/datapacks/Server Rules/on startup, auto-enables it viaserver.reloadResources(...), and refreshespack.mcmetaon every boot so Minecraft version bumps don't leave the pack stranded onDataPacks.Disabled. - Legacy-file detection: if an older install wrote a
rules.jsonwithout the accept/decline buttons, the file is auto-upgraded on next start. Admins can opt out by creating an empty.customizedmarker file next torules.json.
- Install Fabric Loader 0.19.2+ on your server.
- Drop the following jars into the server's
mods/folder:- Fabric API (0.145.4+26.1.1 or newer)
- Inventory Menu (1.1.0 or newer)
server-rules-<version>.jar
- Start the server once. The mod will:
- Create
config/serverrules/config.jsonandrules-accepted.txt. - Generate
<world>/datapacks/Server Rules/with a validpack.mcmeta(min_format: [94, 0],max_format: [101, 1]) and the default menu JSON containing the accept/decline buttons. - Auto-enable the datapack via a resource reload.
- Create
No client-side install is required — everything runs on the server.
- Player joins. If their UUID is in
rules-accepted.txt, nothing happens. - If not, they are marked pending. Slowness / Jump Boost / Blindness are applied immediately so the screen fades to black and the player can't move.
- After a 3-second smoothing delay the chest GUI opens via Inventory Menu.
- The player reads the rules and clicks the Accept (player head of
alphain) or Decline (player head of_3RACHA) button.- Accept → status effects cleared, GUI closed, UUID written to
rules-accepted.txt, welcome message sent. - Decline → kicked with the configured message.
- Timeout (default 120 s) → kicked with the timeout message.
- Accept → status effects cleared, GUI closed, UUID written to
- Future joins by the same player skip the whole flow.
| Command | Who | Effect |
|---|---|---|
/rules |
everyone | Re-opens the GUI. Restricted players get the full freeze + timeout flow; accepted players get a view-only open. |
/rules accept |
pending player | Marks the player as having accepted, clears the freeze effects, closes the GUI, saves state. |
/rules decline |
pending player | Kicks the player with the configured decline message. |
/rules view / /rules-view |
everyone | Opens the menu in view-only mode (no freeze effects). |
/rules reload |
op level 3 | Clears all stored acceptances. Every online player is re-frozen and shown the GUI. |
/rules reload <player> |
op level 3 | Clears one player's acceptance. If they're online, re-freezes them and re-opens the GUI immediately. |
While pending, a player may only run /rules, /rules accept, /rules decline, and /help.
Created automatically on first start with these defaults:
{
"acceptTimeoutSeconds": 120,
"timeoutKickMessage": "You did not accept the server rules in time.",
"declineKickMessage": "You must accept the server rules to play on this server.",
"restrictionMessage": "§cYou must accept the server rules before you can do this. Use §e/rules§c to view them."
}Set acceptTimeoutSeconds to 0 or a negative number to disable the kick
timer entirely.
This is the GUI itself — an Inventory Menu schema with name, rows, and
an items array. Edit this file to change the menu contents, titles, and
colors. Because the mod auto-upgrades legacy installs that lack the
accept/decline buttons, create an empty .customized file next to
rules.json to opt out of further auto-upgrades if you hand-edit the
menu.
Plain-text ledger of every player who has accepted the rules, one per line
in the format uuid:username:
b1d2c3e4-0000-0000-0000-000000000000:Steve
a9f8e7d6-0000-0000-0000-000000000000:Alex
| Symptom | Likely cause | Fix |
|---|---|---|
Unterminated object … $.pack.max_format on /reload |
A truncated pack.mcmeta left over from a crash or the pre-release 1.0.0 build. |
Restart the server. DatapackGenerator rewrites pack.mcmeta on startup, and ServerRules#ensureDatapackEnabled re-enables the pack via reloadResources. |
Pack shown in DataPacks.Disabled inside level.dat_old |
World previously loaded a pack.mcmeta that Minecraft rejected (e.g. pack_format: 101.1 float). |
Restart — the mod will re-enable file/Server Rules automatically. |
| Clicking Accept/Decline does nothing | as_player: true is missing on the action, meaning the command runs as the server console and fails ctx.getSource().getPlayerOrException(). Shouldn't happen on a clean install — most likely you have a legacy rules.json. |
Delete rules.json (or remove the .customized marker if present) and restart so the default is regenerated. |
| GUI opens but the player can still move around | Blindness was only applied for 40 ticks in older builds. | Upgrade to the current build; all three freeze effects now last 10 minutes. |
Full technical reference (architecture, lifecycle, file layout, extension
points): see docs/OUTPUT.md.
MIT — see LICENSE.