Minecraft Server Commands: The Complete Op & Admin List
Op yourself from the console, then run every Minecraft Java command — player management, gamerules, world tools, scoreboards, /execute, data and functions, with permission levels.
Minecraft server commands let you grant admin, manage players, change gamerules, control time and weather, teleport, script behaviour with /execute, and moderate your world without ever leaving the game. This guide covers how to become an operator, where commands can be typed, and every command worth knowing on a Java Edition server.
This guide covers Java Edition dedicated servers
Bedrock dedicated servers share most gameplay commands but use a different permission system and lack many Java-only commands. Differences are covered in section 10, and setup is in Setting up your Bedrock Minecraft server.
1. How Operator Permission Works
An operator (op) is a player granted elevated permissions. Ops are stored in ops.json in your server directory and persist across restarts.
Minecraft has five permission levels, 0 to 4. op-permission-level in server.properties sets the level a player is given when you run /op:
| Level | Grants |
|---|---|
| 0 | Operator status with no extra commands — TPS graph, command-block output in chat, and console output if broadcast-console-to-ops=true |
| 1 | Bypass spawn protection |
| 2 | /gamemode, /give, /tp, /difficulty, /effect, /gamerule, and command blocks |
| 3 | Everything in 2, plus /ban, /kick, /op, /deop, /whitelist |
| 4 | Everything, including /stop |
The default is 4, so a plain /op PlayerName gives full control. Lower it before opping moderators who should not be able to shut the server down.
op-permission-level=4
spawn-protection=16
white-list=false
enforce-whitelist=false op-permission-level is the level recorded against a player in ops.json at the moment you op them — it is a default for newly created ops, not a server-wide ceiling. Changing it does not touch operators who are already in the file: they keep the level already stored for them. Permission level is per-player — edit the level field on any entry in ops.json (then restart) to give one operator a different level from the rest.
2. Where to Type Commands
| Location | Slash needed? | Notes |
|---|---|---|
| Server console | No — type op Steve |
Always runs at permission level 4 |
| In-game chat | Yes — type /op Steve |
Requires op, and the right level |
| Command block | Yes | Needs the command_blocks_work game rule to be true — it is true by default |
| Datapack function | No | Runs at level 2 by default |
op YourUsername Grant your first op from the console
You cannot op yourself in-game before you are an op. Open the Console tab in your GameServerKings panel and run the line above. From then on you can manage everything from chat.
3. Operator & Player Management
| Command | What it does |
|---|---|
/op <player> |
Grant operator status |
/deop <player> |
Revoke operator status |
/kick <player> [reason] |
Disconnect a player |
/ban <player> [reason] |
Ban by account |
/ban-ip <player|address> |
Ban an IP address |
/banlist [players|ips] |
Show active bans |
/pardon <player> |
Unban an account |
/pardon-ip <address> |
Unban an IP |
/list [uuids] |
List online players |
/whitelist add <player> |
Add to the whitelist |
/whitelist remove <player> |
Remove from the whitelist |
/whitelist on / off |
Enable or disable the whitelist |
/whitelist list |
Show whitelisted players |
/whitelist reload |
Re-read whitelist.json after editing by hand |
/setidletimeout <minutes> |
Auto-kick players idle beyond N minutes (0 disables) |
/transfer <host> [port] [players] |
Move players to another server (1.20.5+) |
Turning the whitelist on does not kick anyone
/whitelist ononly blocks new connections from non-whitelisted players. Anyone already online stays until they disconnect. Setenforce-whitelist=trueinserver.propertiesif you want existing non-whitelisted players removed on reload.
4. Player State & Items
| Command | What it does |
|---|---|
/gamemode <mode> [player] |
survival, creative, adventure, spectator |
/defaultgamemode <mode> |
Mode applied to players joining for the first time |
/give <player> <item> [count] |
Give an item, e.g. /give Steve minecraft:diamond 64 |
/clear [player] [item] [count] |
Clear inventory, or just one item |
/item replace <target> <slot> with <item> |
Overwrite a specific inventory or armour slot |
/item modify <target> <slot> <modifier> |
Apply an item modifier from a datapack |
/loot give <player> <source> |
Generate loot-table drops directly into an inventory |
/loot spawn <pos> <source> |
Drop loot-table items in the world |
/effect give <player> <effect> [sec] [amp] |
Apply a status effect |
/effect clear <player> [effect] |
Remove effects |
/enchant <player> <enchantment> [level] |
Enchant the held item |
/experience add <player> <n> [levels|points] |
Grant XP — /xp is the legacy alias |
/experience query <player> <levels|points> |
Read a player's XP |
/attribute <target> <attribute> … |
Modify a base attribute such as max health |
/kill [target] |
Kill a player or entity |
/damage <target> <amount> [type] |
Deal a precise amount of typed damage (1.19.4+) |
/ride <target> mount <vehicle> |
Force an entity to ride another (1.19.4+) |
/ride <target> dismount |
Dismount |
/spectate <target> [player] |
Force a spectator to follow an entity |
5. World, Time & Weather
| Command | What it does |
|---|---|
/time set <day|noon|night|midnight> |
Jump to a time of day |
/time set <ticks> |
Set exact time — 0 is dawn, 6000 noon, 18000 midnight |
/time add <ticks> |
Advance time |
/weather <clear|rain|thunder> [seconds] |
Set the weather |
/difficulty <peaceful|easy|normal|hard> |
Change difficulty |
/gamerule <rule> [value] |
Read or set a gamerule (see below) |
/setworldspawn [pos] |
Set the world spawn point |
/spawnpoint <player> [pos] |
Set an individual player's spawn |
/worldborder set <blocks> [seconds] |
Resize the world border |
/worldborder center <x> <z> |
Recentre the border |
/worldborder damage <amount> |
Damage dealt outside the border |
/worldborder warning distance <n> |
Warning distance |
/seed |
Show the world seed |
/locate structure <id> |
Find the nearest structure |
/locate biome <id> |
Find the nearest biome |
/place structure <id> [pos] |
Place a structure, feature or jigsaw (1.19+) |
/fillbiome <from> <to> <biome> |
Overwrite the biome in a region (1.19.3+) |
/forceload add <from> [to] |
Keep chunks loaded permanently |
/forceload remove <from> [to] |
Stop force-loading |
/tick freeze / unfreeze |
Pause or resume the game tick (1.20.3+) |
/tick step <ticks> |
Advance a frozen world by N ticks |
/tick rate <n> |
Change ticks per second — default 20 |
/tick query |
Report current tick rate and load |
Gamerules worth knowing:
| Gamerule | Effect |
|---|---|
keep_inventory true |
Keep items and XP on death |
advance_time false |
Freeze time — was doDaylightCycle |
advance_weather false |
Freeze weather — was doWeatherCycle |
mob_griefing false |
Stop creepers and endermen altering blocks |
fire_spread_radius_around_player 0 |
Fire stops spreading. Replaces doFireTick, which was removed in 1.21.11. Default 128 blocks; -1 is unlimited |
spawn_phantoms false |
No phantoms — was doInsomnia |
random_tick_speed <n> |
Crop and decay speed — default 3 |
show_death_messages false |
Hide death messages in chat |
show_advancement_messages false |
Hide advancement spam — was announceAdvancements |
players_sleeping_percentage <n> |
Share of players needed to skip night — default 100 |
max_entity_cramming <n> |
Entities stacked before crush damage — default 24, 0 disables |
respawn_radius <n> |
Spread of the initial spawn area — default 10, was spawnRadius |
Game rule names changed in 1.21.11
Java Edition 1.21.11 moved game rules into a registry and renamed every one of them from camelCase to snake_case —
keepInventorybecamekeep_inventory. Several were not simple case changes:doDaylightCycle→advance_time,doWeatherCycle→advance_weather,announceAdvancements→show_advancement_messages,spawnRadius→respawn_radius,naturalRegeneration→natural_health_regeneration,maxCommandChainLength→max_command_sequence_length. Three had their meaning inverted along with the rename, so a straight find-and-replace will get them backwards:disableRaids→raids,disableElytraMovementCheck→elytra_movement_check, anddisablePlayerMovementCheck→player_movement_check— each now takes the opposite value to the rule it replaced. On 1.21.10 and earlier, keep using the old camelCase names.
random_tick_speedis a performance trapRaising it makes crops grow faster, but the cost scales across every loaded chunk. Values above roughly
20will visibly hurt tick rate on a busy server./tick rateis a similar trap — lowering it slows the entire simulation, not just mobs. If you are chasing performance, see Managing your Minecraft server.
6. Teleporting & Building
| Command | What it does |
|---|---|
/tp <target> |
Teleport yourself to a player |
/tp <player> <target> |
Teleport one player to another |
/teleport <target> <x> <y> <z> |
Teleport to coordinates |
/teleport <target> <pos> facing <pos> |
Teleport and face a point |
/spreadplayers <x> <z> <spread> <max> <teams> <targets> |
Scatter players randomly |
/rotate <target> <rotation> |
Rotate an entity without moving it (1.21.2+) |
/setblock <pos> <block> [mode] |
Place a single block |
/fill <from> <to> <block> [mode] |
Fill a region — max 32,768 blocks |
/clone <from> <to> <dest> [mode] |
Copy a region |
/summon <entity> [pos] [nbt] |
Spawn an entity |
/particle <name> [pos] |
Emit particles |
/playsound <sound> <source> <player> |
Play a sound |
/stopsound <target> [source] [sound] |
Stop a playing sound |
Coordinates accept ~ for relative and ^ for directional — /tp ~ ~10 ~ lifts you ten blocks.
7. Scoreboards, Teams & Tags
These drive most minigames, and they are how you track state without a plugin.
| Command | What it does |
|---|---|
/scoreboard objectives add <name> <criteria> [display] |
Create an objective |
/scoreboard objectives list |
List objectives |
/scoreboard objectives remove <name> |
Delete an objective |
/scoreboard objectives setdisplay <slot> [name] |
Show it in the sidebar, list or below-name slot |
/scoreboard players set <target> <objective> <n> |
Set a score |
/scoreboard players add <target> <objective> <n> |
Add to a score |
/scoreboard players get <target> <objective> |
Read a score |
/scoreboard players reset <target> [objective] |
Clear scores |
/scoreboard players operation <t> <obj> <op> <t2> <obj2> |
Arithmetic between scores |
/scoreboard players enable <target> <objective> |
Allow a trigger objective to be used |
/team add <name> [display] |
Create a team |
/team join <name> [members] |
Add members |
/team leave <members> |
Remove members |
/team modify <name> <option> <value> |
Set colour, friendly fire, nametag visibility |
/team empty <name> / /team remove <name> |
Clear or delete |
/tag <targets> add <name> |
Tag entities for later selection |
/tag <targets> remove <name> / list |
Manage tags |
/trigger <objective> [add|set <n>] |
The one scoreboard command non-ops can run |
/teammsg <message> |
Message your team — alias /tm |
/bossbar add <id> <name> |
Create a boss bar |
/bossbar set <id> <value|max|color|players…> |
Configure it |
/bossbar list / /bossbar remove <id> |
Manage boss bars |
8. Advanced: execute, Data & Functions
/execute is the most powerful command in the game — it runs another command as, at, or conditional on something else.
execute as @a at @s run tp ~ ~10 ~
execute as @e[type=zombie] run tag @s add tracked
execute if score Steve deaths matches 5.. run kick Steve
execute store result score Steve ping run data get entity Steve ping | Subcommand | What it changes |
|---|---|
as <targets> |
Who runs the command |
at <targets> |
Where it runs from |
positioned <pos> / rotated <rot> |
Override position or rotation |
facing <pos|entity> |
Point the execution direction |
align <axes> / anchored <eyes|feet> |
Snap to block grid, or use eye height |
in <dimension> |
Run in another dimension |
on <relation> |
Hop to a related entity — vehicle, passenger, owner, attacker |
if / unless |
Condition on block, blocks, entity, score, predicate, data, biome, dimension, loaded |
store result|success |
Write the outcome into a score, NBT path or bossbar |
run <command> |
The command to execute |
NBT and data:
| Command | What it does |
|---|---|
/data get <entity|block|storage> <target> [path] |
Read NBT |
/data merge <target> <nbt> |
Merge NBT in |
/data modify <target> <path> <set|append|insert…> |
Precise NBT edits |
/data remove <target> <path> |
Delete an NBT path |
Datapacks, functions and progression:
| Command | What it does |
|---|---|
/function <namespace:name> |
Run a datapack function |
/schedule function <name> <time> [append|replace] |
Run a function later |
/schedule clear <name> |
Cancel a scheduled function |
/datapack list [available|enabled] |
Show datapacks |
/datapack enable <name> / disable <name> |
Toggle a datapack |
/advancement grant <targets> <everything|only|from|through|until> |
Award advancements |
/advancement revoke <targets> … |
Take them back |
/recipe give <targets> <recipe|*> |
Unlock crafting recipes |
/recipe take <targets> <recipe|*> |
Lock them again |
/random value <range> / /random roll <range> |
Random numbers for map logic (1.20.2+) |
/return <value> / /return fail / /return run <cmd> |
Return a value from a function (1.20.2+) |
Target selectors are where the real power is
@aall players,@pnearest,@rrandom,@sself,@eall entities — each accepts filters:@e[type=zombie,distance=..10,limit=5,sort=nearest]. Combined with/executethis replaces a surprising amount of what people install plugins for.
Newer and specialist commands. These are the least-known part of the command set — most were added recently and several are aimed at map and datapack authors rather than day-to-day moderation.
| Command | What it does | Level |
|---|---|---|
/waypoint |
Manage waypoints shown on the locator bar | 2 |
/dialog |
Show a dialog window to clients | 2 |
/stopwatch |
Create and modify real-time stopwatches | 2 |
/swing |
Swing an entity's hands | 2 |
/fetchprofile |
Fetch a player profile | 2 |
/test |
Manage and run GameTests | 2 |
/version |
Report the server version | — |
/posteffect |
Add or remove post-processing effects on players | 2 |
/publishand/unpublishdo not work on a dedicated serverBoth open or close a single-player world to the local network, so they exist only in the integrated server built into the game client. Running them on your hosted server returns an error — this is expected, not a broken install.
/posteffectis also newer than most current server builds, so check your version if it is unrecognised.
9. Server Operations & Messaging
| Command | What it does |
|---|---|
/save-all [flush] |
Force a world save |
/save-off |
Pause saving — use before an external backup |
/save-on |
Resume saving |
/stop |
Shut down cleanly |
/reload |
Reload datapacks, loot tables and functions |
/say <message> |
Broadcast as the server |
/msg <player> <message> |
Private message (aliases: /tell, /w) |
/tellraw <player> <json> |
Send formatted JSON text |
/title <player> <title|subtitle|actionbar> <json> |
On-screen titles |
/me <action> |
Emote |
/help [command] |
List commands, or show one command's syntax |
/debug start|stop|function |
Profile a tick sample |
/perf start|stop |
Record a performance snapshot |
/jfr start|stop |
Java Flight Recorder profiling for deep analysis |
Always pair
/save-offwith/save-onRunning
/save-offand forgetting to re-enable it means hours of progress live only in memory — a crash loses all of it. The safe manual sequence is below. Scheduled backups on the GSK panel handle this for you.
save-off
save-all flush
# copy your world folder now, then:
save-on 10. Bedrock Edition Differences
Bedrock dedicated servers use permissions.json with three tiers — visitor, member, operator — rather than Java's numeric levels, and ops are granted with op <player> from the console or by editing that file.
Most gameplay commands carry over (/gamemode, /give, /time set, /weather, /tp, /kill, /effect, /scoreboard, /tag, /execute), but Java-only commands do not exist there — including /advancement, /attribute, /debug, /fetchprofile, /fillbiome, /forceload, /jfr, /posteffect, /publish, /random, /return, /rotate, /stopwatch, /swing, /test, /tick, /unpublish and /waypoint. Bedrock's /execute also uses a different syntax before 1.19.30.
Bedrock adds a few of its own, such as /clearspawnpoint for removing a player's spawn. Moderation is usually handled by allowlist (allowlist.json) or an add-on layer, since Bedrock has no native /ban.
If you are running both editions together, see Setting up CrossPlay for Minecraft.
11. FAQ
How do I make myself an admin on my Minecraft server?
Open your server console and run op YourUsername with no slash. You cannot op yourself from in-game chat, because doing so already requires operator permission. Once opped, /op works from chat for everyone else.
Why does my command say "You do not have permission to use this command"?
Either you are not an operator, or op-permission-level in server.properties is set below the level that command needs. /stop requires level 4; /ban and /op need level 3; /gamemode and /give need level 2. Restart the server after changing that value.
Do I type a slash in the server console?
No. The console runs commands directly — type op Steve, not /op Steve. The slash is only needed in in-game chat and in command blocks.
How do I stop losing my items when I die?
Run /gamerule keep_inventory true (/gamerule keepInventory true on 1.21.10 and earlier). It applies to every player on the server and persists across restarts, since gamerules are saved with the world.
Why did /whitelist on not kick the players already online?
The whitelist only filters new connections. Existing players stay until they disconnect. Set enforce-whitelist=true in server.properties to have non-whitelisted players removed when the whitelist reloads.
What is /execute actually for?
It runs a command from someone else's perspective, or only when a condition holds. execute as @a at @s run tp ~ ~10 ~ lifts every player ten blocks from wherever they individually stand — one command instead of one per player. Combined with /scoreboard and target selectors it is how most vanilla minigames are built.
Can I run commands automatically on a schedule?
Yes, three ways without a plugin: a datapack function on a tick cycle, /schedule function for a one-off delay, or a command block on a redstone clock. For plugin-based scheduling, see How to install plugins for Java.
12. What to Read Next
- Getting started with your Minecraft server for first boot and the basics
- How to install plugins for Java — permissions plugins that replace the four op tiers
- How to install mods for Java
- Managing your Minecraft server for backups and performance
- Setting up your Bedrock Minecraft server
- Setting up CrossPlay for Minecraft
Made with 💜 by GameServerKings.
Need a Minecraft server?
Deploy an instantly-provisioned Minecraft server on high-clock hardware — DDoS protected, no contracts, cancel anytime.
From $4.80 /month