Menu
 

Minecraft Server Commands: OP and Console Command List (Java)

Minecraft Server Commands: OP, Console and RCON Reference

Scoped to Java Edition. Bedrock shares most player and world commands but manages operators through permissions.json and its allowlist rather than ops.json and whitelist.json, and has no perf or jfr.

The three places a command can be typed

WhereHow it is typedWhat runs it
Server console (the terminal running the jar, or a panel console)No leading slash: op SteveThe server itself: level 4, no player attached, a fixed position in the Overworld.
In-game chat, typed by an operatorLeading slash: /op SteveThat player, at their own level, from where they stand.
RCON, a console over the networkNo leading slash, sent by a client such as mcrconIdentical to the console. See RCON setup.

Why the console has no player context. The console is not an entity, so @s resolves to nothing and any command defaulting to "whoever ran it" fails: clear and kill need an explicit target there. Relative (~) and local (^) coordinates resolve against the console's fixed Overworld position, not yours, so a bare setworldspawn lands somewhere surprising. Chat-only commands such as /me have nothing to act on.

Operator permission levels

Every command carries a required level from 0 to 4, and each level inherits the ones below it. That is the substance behind "op commands": being an operator is a number, not a switch.

LevelNameWhat it unlocks
0EveryoneNo extra commands. An op at level 0 still sees the TPS graph, command block output, and commands run by other operators and the console while broadcast-console-to-ops is true.
1ModeratorBypasses spawn protection (spawn-protection=16 by default, a square of side 2x+1 around world spawn).
2GamemasterThe whole player and world table below, plus gamerule, difficulty, reload, seed, target selectors, command blocks and operator items in the creative inventory. Command blocks and functions run here by default (function-permission-level=2).
3AdminMultiplayer management: the whole moderation table below, plus setidletimeout, debug and tick.
4OwnerEverything, including the server process: stop, save-all, save-on, save-off, perf, jfr.

op-permission-level in server.properties defaults to 4 and sets the level op grants. Drop it to 2 and ops can build and set gamerules but cannot ban, op each other or stop the server. Per-player levels live in ops.json, rewritten on every op and deop, so hand-edit it only while the server is stopped. Console and RCON are always level 4.

Operator and moderation commands

CommandWhat it doesLevel and usage note
op <targets>Grants operator status.Level 3. New ops receive op-permission-level. Run it from the console the first time, when nobody is op yet.
deop <targets>Revokes operator status.Level 3. Deop yourself and only the console can undo it.
ban <targets> [<reason>]Bans a name and disconnects them at once.Level 3. Stored in banned-players.json. The reason shows on the disconnect screen.
ban-ip <target|address> [<reason>]Bans an address, or an online player's address.Level 3. Stored in banned-ips.json. Catches alt accounts on one connection, and everyone else sharing that address.
pardon <targets>Removes a name from the ban list.Level 3. Takes the player name.
pardon-ip <address>Removes an address from the IP ban list.Level 3. Takes the address, not the name. Read it from banlist ips.
banlist [ips|players]Prints current bans.Level 3. Add ips or players to narrow the output.
kick <targets> [<reason>]Disconnects a player without banning them.Level 3. Also the clean way to force a reconnect after a config or resource pack change.
whitelist on / whitelist offStarts or stops enforcing the whitelist.Level 3. Flips white-list live. off stops checking the list, it does not empty it.
whitelist add <player> / remove <player>Edits whitelist.json.Level 3. Removing someone already online does not kick them unless enforce-whitelist=true.
whitelist listPrints whitelisted names.Level 3. Reads the loaded list, not the file on disk.
whitelist reloadRe-reads whitelist.json.Level 3. Needed after hand-editing the file. With enforce-whitelist=true it kicks anyone no longer listed.

Operators bypass the whitelist entirely, which explains most reports of "the whitelist is not blocking this person".

Server management commands

CommandWhat it doesLevel and usage note
stopSaves every world and shuts down cleanly.Level 4. Always use this instead of killing the process.
save-allWrites world and player data to disk.Level 4. Returns at once; the write continues in the background.
save-all flushSame, but blocks until the write finishes.Level 4. The one to run before copying a world folder.
save-offSuspends automatic saving.Level 4. See the warning below.
save-onRe-enables automatic saving.Level 4. Must always follow a save-off.
reloadReloads data packs: functions, loot tables, advancements, recipes, tags.Level 2. Not server.properties, not plugins. See the warning below.
list [uuids]Online players and the slot count.Level 0, so everyone can run it. list uuids prints UUIDs, which is what hand-editing JSON files needs.
seedPrints the world seed.Level 2 on a server, level 0 in single player.
difficulty [peaceful|easy|normal|hard]Sets or reports difficulty.Level 2. No argument prints the current value. The server.properties entry applies at startup.
gamerule <rule> [<value>]Reads or sets a game rule.Level 2. No value prints the setting. Most asked for: keep_inventory, mob_griefing, random_tick_speed, players_sleeping_percentage, advance_time (was doDaylightCycle) and fire_spread_radius_around_player (was doFireTick, and it is now a radius rather than on or off). Snapshot 25w44a, which became 1.21.11, moved every game rule into a registry and renamed them all from camelCase to snake_case. A guide written before that will give you names a current server rejects.
setworldspawn [<pos>] [<angle>]Sets the world spawn point.Level 2. With no coordinates it uses the executor's position, so always pass coordinates from the console.
setidletimeout <minutes>Kicks players idle for that long.Level 3. 0 disables it. Same setting as player-idle-timeout.
datapack list|enable|disable <name>Lists and toggles data packs.Level 2. Toggling one triggers a reload. See the datapacks guide.
tick query|rate|freeze|unfreeze|step|sprintReads and controls the server tick rate.Level 3, Java 1.20.3 and later. rate accepts 1.0 to 10000.0. Cannot run from a command block.
debug start / debug stopRuns the built-in profiler.Level 3. Output lands in the server's debug folder.
debug function <name>Runs a function with full tracing.Level 3. Writes debug-trace-<timestamp>.txt listing executed commands, messages, errors and return values.
perf start / perf stopCaptures a 10 second performance snapshot.Level 4, dedicated server only, Java 1.17 and later. Writes a zip to debug/profiling with system info, per-dimension entity and chunk CSVs, and tick metrics.
jfr start / jfr stopRecords a Java Flight Recorder profile.Level 4, Java 1.18 and later. A .jfr file plus a JSON summary in debug. For everyday lag the spark profiler reads more easily.

save-off is the command that eats worlds. Nothing reaches disk after it, so everything players do lives only in memory. A crash, an out-of-memory kill or a host reboot rolls it all back to the last save with no warning. The only safe sequence is save-off, save-all flush, copy the files, save-on. Never leave saving disabled.

reload does far less than people assume. Vanilla reload reloads data packs only: not server.properties, not a new plugin jar, not an edited plugin config. On Paper and Spigot the old plugin-reloading behaviour is deprecated for removal because it leaves plugins half initialised, and Paper puts the safe vanilla behaviour on /minecraft:reload. To change plugins, jars or server.properties, restart.

Player and world commands

CommandWhat it doesLevel and usage note
gamemode <mode> [<targets>]Switches mode: survival, creative, adventure, spectator.Level 2. The target is optional in chat and required from the console.
give <targets> <item> [<count>]Puts an item in an inventory.Level 2. IDs are namespaced, such as minecraft:diamond_sword. Since Java 1.20.5 extras are components in square brackets rather than the old NBT tag.
teleport (alias tp)tp <targets> <destination>, tp <targets> <x y z>, optionally facing <entity|pos>.Level 2. The short tp <destination> moves the executor, so it is chat only.
time set|add|queryset day (1000), noon (6000), night (13000), midnight (18000), or a raw tick value.Level 2. time query daytime|gametime|day reads the clock back.
weather clear|rain|thunder [<duration>]Forces the weather.Level 2. Omit the duration for a natural length. Overworld only.
effect give <targets> <effect> [<seconds>] [<amplifier>] [<hideParticles>]Applies a status effect.Level 2. Amplifier 0 is level I, so Strength II is amplifier 1.
effect clear [<targets>] [<effect>]Removes one effect, or all of them.Level 2. The fastest fix for a player stuck under a debuff.
experience add|set|query (alias xp)xp add <targets> <amount> [points|levels].Level 2. Defaults to points when the unit is omitted.
clear [<targets>] [<item>] [<maxCount>]Removes items from an inventory.Level 2. Bare in chat it wipes your own inventory; from the console name a target. Naming an item clears only that item.
kill [<targets>]Kills entities.Level 2. Defaults to @s, so the console needs a target. kill @e[type=item] clears dropped items.
spawnpoint [<targets>] [<pos>] [<angle>]Sets a player's personal respawn point.Level 2. Not the same as setworldspawn, which is the server-wide default.
say <message>Broadcasts a message as the server.Level 2. Works from the console, which makes it the standard restart warning.

For the fiddly ones our free generators emit valid syntax: the give command generator for custom items and enchantments, the effect command generator, and the target selector builder.

Target selectors

Selectors are what turn a command list into a tool. They need permission level 2 and take arguments in square brackets.

SelectorSelectsNote
@pThe nearest player.Nearest to the executor, which from the console is that fixed Overworld position, not you.
@aEvery online player, alive or dead.The safe choice for server-wide effects and announcements.
@rA random online player.Combine with limit to pick several.
@sThe entity that ran the command.Returns nothing from the console, RCON or a command block.
@eAll living entities in loaded chunks, plus online players.Almost always needs a type or limit filter, or it hits everything.
@nThe nearest living entity of any kind.Java only, and unlike @p it can match mobs.

The arguments worth memorising: distance, limit and sort (nearest, furthest, random, arbitrary), type, tag, team, name, gamemode, level, scores, nbt, x/y/z to move the reference point, dx/dy/dz for a box, x_rotation, y_rotation, predicate and advancements. A leading ! inverts a value: @a[gamemode=!creative]. In practice, kill @e[type=minecraft:zombie,distance=..50] clears mobs near spawn without touching players.

Console against chat, and what a command block will not do

Three differences decide where you type a command. The slash: chat needs it, console and RCON reject it. Context: chat inherits your position, dimension and identity, the console inherits none, so a console command acting on a person must name them. Level: the console is permanently 4, while a player is capped by op-permission-level and ops.json.

Command blocks are no way around that. They run at function-permission-level, 2 by default, so the whole moderation and management set is out of reach: no op, ban, kick, whitelist, stop or save-all, and tick refuses outright. They automate the world; managing the server belongs in the console, in RCON, or in an operator's chat.

Cheats, levels and permissions plugins

A dedicated server has no "allow cheats" toggle; the equivalent is holding the right level, so the player and world table needs 2 and the moderation table needs 3. Single player and LAN worlds work the other way, with cheats as a per-world switch.

A permissions plugin changes the model. Paper and Spigot expose vanilla commands as nodes named minecraft.command.<name>, so LuckPerms can grant a builder minecraft.command.gamemode without anyone running op, and revoking it becomes a group edit. Two traps: operators bypass permission checks, so an op appears to hold every node whatever the plugin says, which makes testing misleading unless you test as a non-op; and plugins that replace vanilla commands own the name, so EssentialsX serves /kick, /ban and /gamemode from essentials.* nodes instead. Prefix with the namespace, as in /minecraft:gamemode, to force the vanilla one.

Argument-by-argument syntax for every command is in the official Minecraft Wiki command list.

Related guides

Prefer managed Minecraft Java server hosting? Supercraft runs Minecraft dedicated servers with daily backups, instant setup, and 4 region options.

Launch a Minecraft Java server with this setup

Pick a preset and your new server boots preconfigured - rates, rules and mods already dialed in. Change anything later in the panel.

Browse all Minecraft Java recipes →

Minecraft Hardcore

One life, no second chances: Hardcore mode, Hard difficulty, PvP on. Death is permanent: players are banned t…

Minecraft Creative Build

A peaceful creative server for builders: Creative mode, Peaceful difficulty, flight enabled, PvP off and no s…

Tired of fighting this issue every patch?

Run a managed Minecraft server with us. We handle the patches, mod-version pinning, save backups, and DDoS protection. Set up in minutes, multiple datacenter regions, no contract.

See Minecraft hosting plans →
Top