Skip to content

Minecraft Server Commands: op, whitelist, gamerule and More (26.3)

3 min read

Applies to: Minecraft: Java Edition 26.3 dedicated server (all commands tested on a 26.3 server)

Minecraft servers are run with console commands: making players operators, managing the whitelist, changing rules and saving the world. We ran each command below on a 26.3 server and quote what it answered.

Where to type them

  • Server console (the terminal, tmux session or LinuxGSM console): type the command without a slash.
  • In game, as an operator: the same command with a slash, for example /op Steve.
  • From a script: with LinuxGSM, ./mcserver send "say hello" (see LinuxGSM).

Players and permissions

op Notch                 # Made Notch a server operator
deop Notch               # Made Notch no longer a server operator
list                     # There are 0 of a max of 20 players online
kick Steve Taking a break
ban Steve Griefing
pardon Steve
ban-ip 203.0.113.99      # Banned IP 203.0.113.99: Banned by an operator.
pardon-ip 203.0.113.99

Commands that target a player who isn’t online, such as kick or gamemode, answer No player was found.

Whitelist

whitelist add Notch      # Added Notch to the whitelist
whitelist list           # There are 1 whitelisted player(s): Notch
whitelist remove Notch
whitelist on             # Whitelist is now turned on
whitelist off

New 26.3 servers start with white-list=true in server.properties, so add your players before they try to join.

Game rules: new names in 26.x

The old camel-case game rule names no longer work: gamerule keepInventory true answered Incorrect argument for command. The rules now use lower-case names with underscores:

gamerule keep_inventory true               # Game rule keep_inventory is now set to true
gamerule advance_time false                # stop the day/night cycle
gamerule advance_weather false             # stop weather changes
gamerule pvp false                         # no player-versus-player damage
gamerule players_sleeping_percentage 50
gamerule mob_griefing false

Type help gamerule in the console to list all 58 rules on your version.

World and time

difficulty hard          # The difficulty has been set to Hard
time set day
weather clear            # Set the weather to clear
defaultgamemode survival
seed
say Server restart in 5 minutes
save-all                 # Saving the game ... Saved the game
stop                     # saves and shuts down cleanly

Performance

Vanilla Minecraft has no tps command (it answered Unknown or incomplete command). Use tick query instead; our idle server reported Target tick rate: 20.0 per second and Average time per tick: 0.7ms (Target: 50.0ms). An empty server pauses after 60 seconds by default (Server empty for 60 seconds, pausing).

More: open port 25565, give the server more RAM and make a Minecraft server on Linux. Our Minecraft VPS includes a free Vanilla, Paper or Bedrock installation on request.

Related services

KVM VPS hosting

NVMe SSD and full root access, with Free Basic Managed Support.

Unmanaged dedicated servers

full root access and free IPMI KVM, with Free Basic Managed Support.

Linux server management

hardening, patching, monitoring and automation for Ubuntu, Debian, RHEL and AlmaLinux.

Was this answer helpful?

Still stuck? Open a ticket