
When you need a specific command right now-not buried in a wiki, but immediately accessible. Bookmark this cheatsheet. It covers every essential server command organized by category, with exact syntax and practical examples.
Entity Management
Kill All Hostile Mobs (Without Killing Players or Animals)
This is one of the most searched commands in 2026, and for good reason. When your server's TPS tanks because a broken mob farm spawned 500 zombies, you need to clean them up without wiping out player pets or livestock.
/kill @e[type=!player,type=!item]
Warning: This kills ALL non-player, non-item entities-including armor stands, item frames, and villagers. For a more targeted approach:
Kill only hostile mobs:
/kill @e[type=zombie]
/kill @e[type=skeleton]
/kill @e[type=creeper]
/kill @e[type=spider]
/kill @e[type=enderman]
Kill all entities in a specific radius (100 blocks around you):
/kill @e[type=!player,distance=..100]
Remove only dropped items (lag cleanup):
/kill @e[type=item]
Entity Count Check
Count loaded entities in vanilla Java. The chat reply shows the number of matches:
/execute if entity @e # All loaded entities
/execute if entity @e[type=item] # Only dropped items
Player Management
Operator (OP) Commands
Grant or revoke operator privileges:
/op PlayerName # Grant OP
/deop PlayerName # Revoke OP
Best Practice: Never OP untrusted players. Instead, use a permissions plugin like LuckPerms to grant granular permissions without full OP access.
Banning and Moderation
/ban PlayerName reason # Permanent ban
/ban-ip 192.168.1.100 reason # IP ban
/pardon PlayerName # Unban a player
/pardon-ip 192.168.1.100 # Unban an IP
/kick PlayerName reason # Kick without ban
/whitelist add PlayerName # Add to whitelist
/whitelist remove PlayerName # Remove from whitelist
/whitelist on # Enable whitelist mode
Gamemode Commands
/gamemode survival PlayerName
/gamemode creative PlayerName
/gamemode spectator PlayerName
/gamemode adventure PlayerName
Shorthand (EssentialsX plugin only; vanilla Java needs the full mode name):
/gm 0 PlayerName # Survival
/gm 1 PlayerName # Creative
/gm 2 PlayerName # Adventure
/gm 3 PlayerName # Spectator
World Management
World Border
Essential for controlling exploration and pre-generation:
/worldborder center 0 0 # Set border center
/worldborder set 10000 # Set border diameter (blocks)
/worldborder set 5000 300s # Shrink to 5000 over 300 seconds (on 1.21.10 and older: 300)
/worldborder get # Check current size
/worldborder warning distance 100 # Warning at 100 blocks from edge
Time and Weather
/time set day # Set to daytime
/time set night # Set to nighttime
/time set 6000 # Set to noon (tick value)
/gamerule advance_time false # Freeze the time (doDaylightCycle on 1.21.10 and older)
/weather clear # Clear weather
/weather rain # Start rain
/weather thunder # Start thunderstorm
/gamerule advance_weather false # Freeze weather (doWeatherCycle on 1.21.10 and older)
Teleportation
/tp PlayerName 100 64 -200 # Teleport to coordinates
/tp PlayerName OtherPlayer # Teleport to another player
/tp @a 0 100 0 # Teleport ALL players to coordinates
To find the numbers first, see our guide to showing coordinates on Java and Bedrock.
Server Performance Commands
TPS and Performance
/tick query # Vanilla tick rate and time per tick (1.20.3+)
/tps # Ticks per second (Spigot and Paper)
/mspt # Milliseconds per tick (Paper)
Spark Profiler (requires Spark plugin/mod)
/spark profiler start # Begin profiling
/spark profiler stop # Stop and generate report
/spark tps # Detailed TPS breakdown
/spark gc # Garbage collection stats
/spark health # Overall server health
Memory and Debug
/debug start # Start debug profiling
/debug stop # Stop and save report
Gamerules Reference
Gamerules control fundamental server behaviors. Java 1.21.11 renamed every game rule to a snake case ID (Game rule), so use the first column on 1.21.11 and 26.x, and the second on 1.21.10 and older:
| 1.21.11 and newer | 1.21.10 and older | What it does |
|---|---|---|
/gamerule keep_inventory true | /gamerule keepInventory true | Players keep items and XP on death |
/gamerule mob_griefing false | /gamerule mobGriefing false | Stops creepers and endermen changing blocks |
/gamerule fire_spread_radius_around_player 0 | /gamerule doFireTick false | Stops fire spreading |
/gamerule spawn_mobs false | /gamerule doMobSpawning false | Disables natural mob spawns |
/gamerule players_sleeping_percentage 50 | /gamerule playersSleepingPercentage 50 | 50% of players needed to skip the night |
/gamerule random_tick_speed 3 | /gamerule randomTickSpeed 3 | Default random tick speed |
/gamerule respawn_radius 10 | /gamerule spawnRadius 10 | Spawn point radius |
/gamerule max_entity_cramming 24 | /gamerule maxEntityCramming 24 | Entity cramming limit |
/gamerule show_advancement_messages false | /gamerule announceAdvancements false | Hides advancement messages |
For keep inventory on Bedrock, Realms and multi-world servers, see our keep inventory guide. For what each random tick speed value does to crops and MSPT, see our tick speed guide.
Server Properties Quick Reference
These are set in server.properties (not in-game commands):
# Performance
view-distance=10
simulation-distance=8
max-tick-time=60000
network-compression-threshold=256
# Security
online-mode=true
enable-command-block=false
white-list=false
enforce-whitelist=false
# Gameplay
pvp=true
difficulty=hard
max-players=20
spawn-protection=16
Console Commands
These are usually run from the server console, where you type them without a slash. Operators with permission level 4 can also run stop and the save commands in game, and list works for every player:
stop # Gracefully stop the server
save-all # Force a world save
save-off # Disable auto-saving (for backups)
save-on # Re-enable auto-saving
list # List online players
Running these on your own server
On a dedicated server you run commands in two places. The console, which is the Console tab on a Pterodactyl panel, takes any command without a slash and is where you op yourself the first time. Everything else in this list then works in game with a slash. Commands that depend on where you stand, such as /tp with only coordinates or selectors with distance=..100, belong in game: the console is not a player and works from the world spawn. /tps and /mspt only exist on Spigot or Paper, /gm needs EssentialsX, and /spark needs the spark plugin or mod. Space-Node's Minecraft server hosting runs on this panel, so the console is there from the first start.
Need More Performance?
If you've cleaned up entities, optimized gamerules, and profiled with Spark but your server still can't maintain 20 TPS, the bottleneck is your hardware. Space-Node's hosting plans use AMD Ryzen processors and NVMe storage, providing the raw single-thread performance that Minecraft demands.