Running a Minecraft server is like owning a house - it’s mostly fun and comfy until a pipe bursts at 11PM and your friends are all looking at you because it’s your house, you’re supposed to know how to deal with these things. While you could certainly call a plumber - or Akliz technical support - sometimes it’s quicker and easier to handle things yourself, and it’s good to have a toolbox around when you need something done. Fortunately, Minecraft includes a built-in toolbox of console commands for exactly those moments. You don’t need to memorize every wrench in the box (there are a lot and some of those wrenches are weird shapes) but a small handful can help cover the majority of situations.
Who’s in charge?
First and foremost, the command you’ll probably want to use within 5 minutes of setting up the server is /op.
Typing /op YourUsername grants your character Operator status, which unlocks the entire suite of commands to be used in-game. Otherwise, commands need to be run from the server console. You’ll need to do this from the console for the first time, in order to get access to the commands to begin with, but from there on you can just enter commands directly into your game’s chat box. To access your console through the Akliz server dashboard, just click on the name of the server - if you’re using a different server management tool, it might be slightly different.
Protip: When running commands from the server console, the / in front isn’t needed, so you can just enter the command as: op YourUsername
Keep in mind that anyone with Operator permissions has complete, unrestricted access to all further commands - so don’t go handing this out like candy. Particularly not to that one friend who thinks that TNT is a personality. Generally this is best done only for server owners, and to select trusted admins.
Bending the rules
Safe, in my lane, and thriving (because mob griefing is off)
Now, on to the actual fun ones.
The /gamerule command lets you fundamentally alter the laws of the universe (in minecraft), and a few of them are sure to be staples for almost every server. The exact format for each rule has changed a bit in recent versions of Minecraft, so you might have to check and see what works for your version, but here are some examples:
/gamerule players_sleeping_percentage 0 or playersSleepingPercentage 0 removes the need to have all players sleeping to pass the night. The number at the end is a percentage - setting it to 50 means half the server needs to sleep, but setting it to 0 lets a single sleeper advance time for everyone.
/gamerule mob_griefing false or mobGriefing false stops Creepers from blowing holes in your builds, and stops endermen from littering your lawn with random dirt blocks.
/gamerule keep_inventory true or keepInventory true can be helpful for friends who tend to go swimming in lava a lot, as it stops players from dropping their items all over the ground on death.
A full list of game rules can be found on the Minecraft wiki: https://minecraft.wiki/w/Game_rule
Terminating lag with extreme prejudice
Sometimes, things go wrong, and the server needs rescuing. Maybe a creeper blew up your cobblestone storage chests (see “mobGriefing” above on how to stop that!) or maybe that one friend “just wanted to see” and used a chainsaw on one of Twilight Forest’s trees. This is where the /kill command comes to save you.
This command will delete certain objects or entities from the server, depending on how you format it. For example, in the situation described above, the ground is littered with dropped items, slowing everything to a crawl. The command /kill @e[type=item] will get rid of every single (that’s what the @e means) item-type entity that has been dropped on the ground. Sometimes, if you leave an automated farm running for too long, items can build up, and the server crashes. When that happens, running this command right as the server starts up, or right as a player joins the server, can save the day.
Be careful with that @e, however. Running the command with just that, and no modifiers, will kill everything on the server. All your pets, your village trading hall, your golems, and every player - all at once.
If things get really bad, and the nuclear option is the only option, you might use /kill @e[type=!player] - this might sound like you’re killing your players, but the ! in front actually means “not these”. This command kills off every non-player entity, and can be the last resort if you accidentally left that mob farm running for a bit too long.
Stunt performed by a professional on a closed course — do not attempt
Honorable mentions
Anyone who’s fiddled around with console commands will know, there are far too many to list all of them in this article. So, here’s a few more with quick, simple uses that many players might like.
/whitelist can be used to control who can access your server - handy if you’re worried about trolls or just want to keep your server secure. We have a quick article on how to turn this on and modify who has access here.
/time lets you change the time. Easy, and nice if you’re just starting off and don’t have a bed yet. /time set day jumps to daytime, and you can use night instead if you want a quick sunset. Using /time add followed by a number lets you bump the clock forward a bit instead of just setting it - useful if you want a specific time, or if you’re concerned about accidentally resetting the in-world Days counter.
Similarly, if you’re stuck in a storm and you’d rather it not, /weather clear will blow that rain away and bring the sunshine back.
/tp lets you teleport anyone anywhere, by naming a target & a location. That location can be coordinates, or it can be other people! /tp YourName TheirName will let you zip over to your friend’s location from anywhere.
Maybe you’re not in the game, because you’re managing the server from the console, and you want to get the attention of the players who are - maybe just to say hi, maybe because you’re about to turn the server off for a quick update, or maybe you want to send messages at regular intervals to let players know about scheduled restarts, or other timed events. /say followed by any message will post that message to chat, even from the server console, letting you join in on the convo. Want to REALLY get their attention? The /title command will let you make Big Words pop up on screen to really get their attention, including fancy text and images! Formatting these can be tricky, but there’s some really cool tools out there that can help.
You can even use /playsound to add an extra emphasis to your messages!
Ready to run your own commands?
If you’ve ever played on someone else’s server, and ever wondered what it would be like to have all this power (and the responsibility), there’s no better time to start than the present. You can get your own Minecraft server up and running in just a few minutes right here and wow all your friends with your newfound power. You can also come talk about your favorite commands on our Discord server. We can’t stop you from inviting Explodin’ Jimmy to your server, but we can help you with the commands to patch the holes he leaves behind.
