On this pageWhere commands run
Most Minecraft admin work comes down to a few dozen commands, and two recent changes broke a lot of old notes. Java 1.21.11 renamed every game rule to a snake_case name, so keepInventory is now keep_inventory. Then 26.3 made the whitelist the default on freshly generated servers, so a new server turns away everyone who is not on the list. This sheet groups the commands by the job you are doing and flags what changed.
Everything here targets Java Edition 26.x with a vanilla or Paper server. Bedrock shares many commands but differs in names and details, so check its own documentation before you copy anything across.
Where commands run
Commands work in three places, with one small difference in syntax:
- The server console (the terminal running the jar, or your panel's console). Type commands without the leading slash:
whitelist add Alex. - In game, from the chat box, with a slash:
/whitelist add Alex. The player needs operator rights. - Remote tools over RCON or the newer management protocol, covered at the end.
Who may run what is set by operator levels. /op <player> grants the level in op-permission-level from server.properties, which defaults to 4.
| Level | What it allows |
|---|---|
| 1 | Build inside spawn protection |
| 2 | Cheat-style commands such as /gamemode, /give, /tp, /gamerule, and editing command blocks |
| 3 | Player management: /ban, /kick, /op, /deop, /whitelist |
| 4 | Everything, including /stop and the save commands |
To give a trusted moderator level 3, op them once, stop the server, change the level field of their entry in ops.json and start it again. Keep level 4 for the owner only. The fewer accounts that can stop the server, the fewer ways a stolen password can hurt you.
Decide who gets in
The whitelist
Since 26.3, a server that generates its own server.properties starts with white-list=true. Servers upgraded from older versions keep their previous setting. Operators can always join, which is why the owner often does not notice until friends report that they are "not whitelisted".
whitelist add Alex
whitelist remove Alex
whitelist list
whitelist on
whitelist off
whitelist reload
Entries are stored with the account's UUID as well as its name, so a player who changes their username stays on the list. That only holds while online-mode=true, the default, which makes the server verify every login with Microsoft. With online mode off, anyone can connect under any name, including yours, and the whitelist stops meaning much.
whitelist reload rereads whitelist.json after you edit it by hand. Set enforce-whitelist=true if you want players who are online but not on the list to be kicked as soon as the list reloads, which is useful after you remove someone.
Operators, kicks and bans
op Alex
deop Alex
kick Alex Take a break and read the rules
ban Alex Griefing at spawn
ban-ip 203.0.113.25 Alt accounts
pardon Alex
pardon-ip 203.0.113.25
banlist players
Bans land in banned-players.json and banned-ips.json, operators in ops.json. Those files are plain JSON, so they belong in your backups next to the world. IP bans are blunt: players on shared or mobile connections can sit behind one address, and anyone with a VPN walks around them.
Fix problems on the spot
tp Alex 120 64 -340
tp Alex Sam
gamemode spectator Alex
gamemode survival Alex
give Alex minecraft:oak_log 64
clear Alex minecraft:tnt
effect give Alex minecraft:night_vision 300
spawnpoint Alex 0 70 0
setworldspawn 0 70 0
Spectator mode is the polite way to inspect a griefing report: you can fly through walls and watch without touching anything. To clear lag from dropped items after a farm overflows, kill @e[type=item] removes every item entity in loaded chunks. Narrow the selector before you run anything broader, because kill @e with no filter also removes animals, villagers and armor stands.
World rules after the rename
Game rules control daylight, mob spawning, inventory loss and more. In 1.21.11 they moved to snake_case names, and several were renamed outright. Old names only work on 1.21.10 and earlier, which is why copied commands from older guides now fail with an unknown game rule error.
| Old name (1.21.10 and earlier) | Name on 26.x |
|---|---|
keepInventory |
keep_inventory |
doDaylightCycle |
advance_time |
doWeatherCycle |
advance_weather |
doMobSpawning |
spawn_mobs |
mobGriefing |
mob_griefing |
doInsomnia |
spawn_phantoms |
playersSleepingPercentage |
players_sleeping_percentage |
announceAdvancements |
show_advancement_messages |
spawnRadius |
respawn_radius |
doImmediateRespawn |
immediate_respawn |
doFireTick |
removed; use fire_spread_radius_around_player |
Two former server.properties keys are now game rules as well: pvp, and command blocks, which are switched with command_blocks_work. Run gamerule <name> without a value to read the current setting.
gamerule keep_inventory true
gamerule players_sleeping_percentage 50
gamerule fire_spread_radius_around_player 0
gamerule pvp false
gamerule spawn_phantoms false
The everyday world commands did not change:
time set day
weather clear
difficulty hard
worldborder center 0 0
worldborder set 10000
A world border keeps exploration, and therefore world size and backup size, under control. Pair it with a pre-generated map and the server stops generating chunks in the middle of a busy evening.
Save, back up and stop cleanly
Copying a world folder while the server writes to it can capture half-saved region files. The safe sequence is to pause autosaves, flush everything to disk, copy, then resume. This script assumes the server runs from /opt/minecraft inside a tmux session named mc:
#!/bin/bash
tmux send-keys -t mc "save-off" Enter
tmux send-keys -t mc "save-all flush" Enter
sleep 10
tar -czf /backups/world-$(date +%F-%H%M).tar.gz -C /opt/minecraft world
tmux send-keys -t mc "save-on" Enter
save-all flush waits until the chunks are written, and the pause gives a busy server time to finish. To shut down, always use stop rather than killing the process: it saves every world and disconnects players properly. A process killed in the middle of a save is the classic cause of a corrupted region file.
Diagnose lag and check the basics
list
seed
tick query
debug start
debug stop
list shows who is online, and seed prints the world seed, which you will want before any map tool or world reset. tick query reports the target tick rate and how long ticks are taking; anything consistently above 50 ms per tick means the server cannot keep 20 ticks per second. debug start and debug stop write a short profiling report. Paper servers add mspt and ship the spark profiler, which gives a far more readable picture of which plugin, entity or chunk is eating the time.
Run commands remotely
RCON lets scripts and admin tools send commands over TCP. Enable it in server.properties:
enable-rcon=true
rcon.port=25575
rcon.password=use-a-long-random-string
RCON traffic is not encrypted and the password travels in the clear, so never expose port 25575 to the internet. Keep it to localhost and connect through SSH, or allow only your own IP address. On a CloudSat server, a cloud firewall rule does that before traffic even reaches the machine.
Since 1.21.9 there is also an official management protocol, switched on with management-server-enabled=true. It speaks JSON-RPC over WebSocket with TLS on by default and an auto-generated secret, and it suits dashboards and bots that need structured data rather than console text.
FAQ
Why does /gamerule keepInventory true say the rule does not exist?
Because the rule is now called keep_inventory. Every Java game rule moved to snake_case in 1.21.11, and some got new names entirely, such as advance_time for the old daylight cycle rule. Update scripts, datapacks and plugin configs that set rules by name.
Why can nobody join my new 26.3 server?
Fresh 26.3 servers generate white-list=true. Add each player with whitelist add <name>, or set white-list=false and restart if you really want an open server. Operators bypass the list, which hides the problem from the owner.
Can I give a moderator ban rights without full control?
Yes. Op them, then set their entry in ops.json to level 3 while the server is stopped, because the file is read at startup. They can kick, ban and manage the whitelist, but they cannot stop the server. For finer control, a permissions plugin on Paper lets you grant single commands to groups.
Do these commands work on Bedrock?
Many do, with differences. Bedrock calls the whitelist an allowlist, keeps its own lowercase game rule names such as keepinventory, and handles permissions in its own files. Treat this sheet as Java only.
Run it on CloudSat. Cloud VPS on AMD EPYC and NVMe from $1.98/mo in 13 regions, delivered in under 5 minutes and paid in crypto. See plans or deploy a server.




