
GameruleLock
Pin your gamerules in a config file and keep them there — GameruleLock re-applies your chosen values on startup, world load, and even after runtime…
⬇ Download on ModrinthGameruleLock
Lock your gamerules to the values you chose — permanently.
GameruleLock verifies every gamerule you pin in its config on server startup and on every world load, writes the configured value back whenever it deviates, and logs each correction. No more "why is keepInventory off again?" panic after a restart, a world import, or a well-meaning admin's /gamerule command.
✨ Features
- 🔒 Config-based locking — pin gamerule values per world, or for all worlds at once via a
defaultblock. Gamerules not listed in the config are never touched. - 🚦 Startup enforcement — all loaded worlds are checked when the plugin enables; any drift is reverted immediately.
- 🌍 World-load enforcement — worlds loaded later (e.g. through Multiverse) go through the same check via
WorldLoadEvent. - 🛡️ Optional runtime protection — with
enforce-on-change: true, any conflicting change is reverted within one tick, whether it came from a player's/gamerule, the console, RCON, or another plugin. Whoever ran a conflicting command is told why their change was reverted; the command itself is never blocked. - 📝 Change log — every correction is written to the console and (optionally) appended to
plugins/GameruleLock/changes.logwith a timestamp, the world, the value found, the value written, and what triggered the check. - 📸 Snapshot command —
/grl capturewrites the current gamerules of a world (or all worlds) straight intoconfig.yml, so you never have to hand-write YAML.
🚀 Installation
- Download the GameruleLock jar.
- Drop it into your server's
plugins/folder. - Restart the server. The default
plugins/GameruleLock/config.ymlis created. - Either edit
config.ymlby hand, or set your gamerules in game the way you want them and run/grl capture allto lock everything in as-is.
Requirements: Paper (or a Paper fork) for Minecraft 1.20.x–1.21.x, Java 21. Only stable Bukkit/Paper API is used — no NMS, no reflection.
⌨️ Commands
Main command: /grl (alias: /gamerulelock).
| Command | Description | Permission |
|---|---|---|
/grl check [world] |
Compare current values against the locked ones and list deviations (changes nothing) | gamerulelock.check |
/grl enforce [world] |
Run enforcement now and revert any deviations | gamerulelock.enforce |
/grl capture <world|all> |
Snapshot current gamerule values into config.yml and save the file |
gamerulelock.capture |
/grl reload |
Reload config.yml, then run enforcement |
gamerulelock.reload |
All permissions default to op.
⚙️ Configuration
# Revert runtime changes (player /gamerule, console, RCON, other plugins)
# that conflict with a locked value? Commands are not blocked; the value is
# corrected within one tick.
enforce-on-change: true
# Also append corrections to plugins/GameruleLock/changes.log?
# (Console logging is always on.)
log-to-file: true
# Send a short summary to online operators whenever corrections are made?
notify-ops: true
# Locks applied to every world.
default:
keepInventory: true
doFireTick: false
# Per-world locks. These override the "default" block for that world.
worlds:
world_nether:
doMobSpawning: false
Notes:
- Values must match the gamerule's type —
true/falsefor boolean rules, whole numbers for integer rules (e.g.randomTickSpeed: 3). - An unknown gamerule name or a wrong value type is skipped with a console warning; the rest of the config keeps working.
- The effective locks for a world are the
defaultblock merged with that world's entry underworlds, with the world entry winning on conflicts. - Gamerules that appear nowhere in the config are left completely alone.
📄 Change log file
When log-to-file is enabled, every correction is appended to plugins/GameruleLock/changes.log as one plain-text line:
2026-07-21 14:03:12 [startup] world: keepInventory false -> true
The trigger tag is one of startup, world-load, runtime (a runtime change was reverted) or manual (/grl enforce / /grl reload). File writes happen off the main thread, so logging never costs you ticks.
🎯 What GameruleLock deliberately does not do
No GUI, no database, no web panel, and no locking of non-gamerule settings such as difficulty or spawn flags. It does one thing: keep your gamerules where you put them.
- Ships as gamerulelock-1.0.0.jar — drop this file into the mods folder
- Download size: 21 KB
- Download link checked 12 Aug 2026 — working
These come from our own check of the pack file, not from the source page.