Skip to content
Back to Homepage

All Minecraft Java Edition Console Commands

Minecraft Java Edition Server Console Commands

Section titled “Minecraft Java Edition Server Console Commands”

This page lists Minecraft Java Edition server console commands. Each command includes a description, an example, and the OP level required to run it. The complete command list is below.

In-game chat uses the same command arguments, with a leading /. On the dedicated server console, enter that command without the leading /.

Operator permissions apply when a player runs a command in chat. The player must be an operator, and their permission level must be at least the OP level listed for that command. A higher level includes every command from the levels below it. The level granted by /op comes from op-permission-level in server.properties, which defaults to 4. The server console already runs at the highest permission level, so operator status is not required there.

These examples and OP levels are for Java Edition. Bedrock Edition uses different syntax and permission levels for many of the same command names. Java /gamemode takes the mode first (/gamemode creative PlayerName) and does not accept a numeric mode. Java /difficulty accepts peaceful, easy, normal, or hard. A numeric difficulty such as 3 is a Bedrock form. Commands such as /give, /tp, /time, and /weather require OP level 2 in Java and OP level 1 in Bedrock. Java /whitelist requires OP level 3. Bedrock /whitelist, also called /allowlist, requires OP level 4.

Command syntax, console entry, and permission levels are documented on the Minecraft Wiki: Commands, permission level, server.jar, and server.properties.

These commands are taken from the complete list and grouped by the job they do on a server. The example and OP level for each one match that list. Replace PlayerName with the player’s username.

Example OP level
/ban PlayerName 3
/kick PlayerName 3
/pardon PlayerName 3
Example OP level
/op PlayerName 3
/deop PlayerName 3
Example OP level
/whitelist add PlayerName 3
Example OP level
/tp PlayerName 0 0 0 2
Example OP level
/gamemode creative PlayerName 2
/defaultgamemode creative 2
Example OP level
/give PlayerName minecraft:diamond_block 64 2
/clear PlayerName 2
Example OP level
/time set day 2
Example OP level
/weather clear 2

Replace PlayerName with the player’s username. EntityName, OtherEntity, and TargetName stand in for entity names. The spectator command names the entity first, then the player who is spectating.

Command Description Example OP level
/advancement Gives, removes, or checks player advancements /advancement grant PlayerName everything 2
/attribute Queries, adds, removes, or sets an entity attribute /attribute PlayerName minecraft:attack_speed base set 100 2
/ban Adds a player to the ban list /ban PlayerName 3
/ban-ip Adds an IP address to the ban list /ban-ip 123.45.67.89 3
/banlist Displays the ban list /banlist 3
/bossbar Creates and modifies boss bars Used in datapacks 2
/clear Clears items from a player inventory /clear PlayerName 2
/clone Copies blocks from one place to another /clone 0 0 0 100 100 100 -100 -100 -100 2
/damage Applies damage to the selected entities /damage PlayerName 10 2
/data Gets, merges, modifies, and removes block entity and entity NBT data Used in datapacks 2
/datapack Controls loaded datapacks. Creating a pack with /datapack create requires OP level 4 /datapack list 2
/debug Starts or stops a debugging session /debug start 3
/defaultgamemode Sets the default game mode /defaultgamemode creative 2
/deop Revokes operator status from a player /deop PlayerName 3
/difficulty Sets the difficulty level /difficulty hard 2
/effect Adds or removes a status effect /effect give PlayerName minecraft:regeneration 2
/enchant Adds an enchantment to a player’s selected item /enchant PlayerName minecraft:unbreaking 2
/execute Executes another command /execute run say I executed this! 2
/experience Adds or removes player experience /experience add PlayerName 100 2
/fill Fills a region with a specified block /fill 0 0 0 100 100 100 minecraft:diamond_block 2
/fillbiome Fills a region with a specified biome /fillbiome 0 0 0 100 100 100 minecraft:badlands 2
/forceload Forces chunks to stay loaded or not /forceload add 0 0 2
/function Runs a function /function myfunction 2
/gamemode Sets a player’s game mode /gamemode creative PlayerName 2
/gamerule Sets or queries a game rule /gamerule playersSleepingPercentage 20 2
/give Gives a player an item /give PlayerName minecraft:diamond_block 64 2
/help Provides help for commands /help gamemode 0
/item Manipulates items in inventories /item replace entity PlayerName armor.chest with minecraft:netherite_chestplate 2
/jfr Starts or stops JFR profiling /jfr start 4
/kick Kicks a player from the server /kick PlayerName 3
/kill Kills entities /kill PlayerName 2
/list Lists players on the server /list 0
/locate Locates the closest structure, biome, or point of interest /locate structure minecraft:ancient_city 2
/loot Drops items from an inventory slot onto the ground /loot spawn ~ ~ ~ mine ~ ~-1 ~ 2
/me Displays a message about the sender /me is playing Minecraft 0
/msg An alias of /tell and /w. Displays a private message to other players /msg PlayerName secret message! 0
/op Grants operator status to a player /op PlayerName 3
/pardon Removes a player from the ban list /pardon PlayerName 3
/pardon-ip Removes an IP address from the ban list /pardon-ip 123.45.67.89 3
/particle Creates particles /particle minecraft:bubble ~ ~ ~ 0 0 0 0.1 100 normal 2
/perf Captures info and metrics about the game for 10 seconds /perf start 4
/place Places a configured feature, jigsaw, template, or structure /place structure minecraft:village_desert 2
/playsound Plays a sound /playsound minecraft:ambient.cave master @a 2
/publish Opens a single-player world to the local network. This command is not available on a dedicated server /publish 4
/random Draws a random value or controls the random number sequence. Drawing a value requires OP level 0. Using or resetting a sequence requires OP level 2 /random roll 1..6 0
/recipe Gives or takes player recipes /recipe give PlayerName minecraft:crafting_table 2
/reload Reloads loot tables, advancements, and functions from disk /reload 2
/return Controls execution flow inside functions and changes their return value Used in datapacks 2
/ride Makes entities ride other entities, or stops entities from riding /ride EntityName mount OtherEntity 2
/save-all Saves the server to disk /save-all 4
/save-off Disables automatic server saves /save-off 4
/save-on Enables automatic server saves /save-on 4
/say Displays a message to multiple players /say hello all! 2
/schedule Delays the execution of a function /schedule function myfunction 100s 2
/scoreboard Manages scoreboard objectives and players /scoreboard players set PlayerName objective 1 2
/seed Displays the world seed. On a multiplayer server this requires OP level 2 /seed 2
/setblock Changes a block to another block /setblock 0 0 0 minecraft:slime_block replace 2
/setidletimeout Sets the time before idle players are kicked, in minutes /setidletimeout 120 3
/setworldspawn Sets the world spawn /setworldspawn 0 0 0 2
/spawnpoint Sets the spawn point for a player /spawnpoint PlayerName 0 0 0 2
/spectate Makes a player in Spectator mode spectate an entity. Name the entity first, then the spectator /spectate TargetName PlayerName 2
/spreadplayers Teleports entities to random locations /spreadplayers 0 0 1 10 false @a 2
/stop Stops a server /stop 4
/stopsound Stops a sound /stopsound PlayerName master 2
/summon Summons an entity /summon minecraft:bat 2
/tag Controls entity tags /tag EntityName add myTag 2
/team Controls teams /team add Red 2
/teammsg An alias of /tm. Sends a message to the team /teammsg help cap blue 0
/teleport Teleports entities /tp PlayerName 0 0 0 2
/tell An alias of /msg and /w. Displays a private message to other players /tell PlayerName secret message! 0
/tellraw Displays a JSON message to players /tellraw @a {"text":"Hello"} 2
/time Changes or queries the world’s game time /time set day 2
/title Manages screen titles /title PlayerName clear 2
/tm An alias of /teammsg. Sends a message to the team /tm where is the team right now 0
/tp An alias of /teleport /tp PlayerName 0 0 0 2
/trigger Sets a trigger to be activated /trigger mytrigger 0
/w An alias of /tell and /msg. Displays a private message to other players /w PlayerName hello friend! 0
/weather Sets the weather /weather clear 2
/whitelist Manages the server whitelist /whitelist add PlayerName 3
/worldborder Manages the world border /worldborder add 100 2
/xp An alias of /experience. Adds or removes player experience /xp add PlayerName 100 2