Minecraft/Bukkit server commands
We now have all of our custom options set. Next, we are ready to log into the server and take a look at the in-game server commands.
To log into your server, you will need to know the IP address of your computer. Later in this chapter we will work through finding this essential information. However, I will assume that for now you will be playing Minecraft on the same machine that you are running your server on. In this case, for the IP of the server, simply type localhost
. Once you are connected to your server, you will notice that the CraftBukkit server is essentially the same as a vanilla server. This is because you do not have any plugins installed yet. The first indication that the server is running Bukkit is that you will have a few extra commands.
Bukkit inherits all of the Minecraft server commands. If you have ever played on a Minecraft server, then you have probably already used some of these commands. In case you have not, I will explain some of the more useful ones. These commands can be typed into the console or in-game. By console I am referring to the command prompt that is running your server. CraftBukkit has a built-in permissions system that limits players from using specific commands. They cannot use a command if they do not have the necessary permission. We will discuss this in further detail in a later chapter, but for now we will make your player an operator, or op for short. An operator automatically has all of the permissions, and will be able to execute all of the commands that will be presented. To make yourself an operator, we will issue the op
command to the console:
# op <player>
Replace <player>
with your player name. See the highlighted command in the following screenshot for an example:
Once you have been opped, you are ready to test some of the server commands in-game. In order to understand how to use commands properly, you must understand the command syntax. We will look at the gamemode
command as an example:
gamemode <0 | 1 | 2> [player]
< >
indicates that it is a required argument.[ ]
indicates that it is an optional parameter. For this command, if the player parameter is not included, then the game mode of your own player will be set.|
is a known symbol for the word or. So<0 | 1 | 2>
indicates that either 0, 1, or 2 can be entered. They represent survival, creative, and adventure, respectively.Parameters must always be typed in the same order in which they are displayed. Usually, if you enter an incorrect command, a help message will appear reminding you of how to use the command properly.
Take note that when you issue a command in-game, you must start with /
, but when issuing a command from the console, /
must be left out. A proper use of the gamemode
command would be /gamemode 1
, which will set your game mode to Creative, as shown in the following screenshot:
Another example of this command is /gamemode 2 Steve
, which will find the player whose username is Steve
and will change his game mode to adventure.
Now that you understand the basic syntax for commands, I will list some other useful server commands, as shown in the following list. Most of these commands are present in Vanilla Minecraft. Only a few of them are specific to Bukkit servers.
(For vanilla)
gamerule <rule> [true | false]
The rule parameter can be set to any of the following:
doMobSpawning
– Whether mobs will naturally spawnkeepInventory
– Whether players will keep their items if they diemobGriefing
– Whether mobs such as creepers can destroy blocksdoFireTick
– Whether fire should be spreaddoMobLoot
– Whether mobs should drop itemsdoDaylightCycle
– Whether the day/night cycle is in effectFor example,
/gamerule mobGriefing false
(For vanilla)
give <player> <item> [amount [data]]
For example,
/give Codisimus wool 3 14
, gives Codisimus 3 red wool
(For Bukkit)
plugins
For example,
/plugin
s or /pl
, displays a list of all the plugins that are installed on your server
(For Bukkit)
reload
For example,
/re
load or/rl
, disables all plugins and reenables themThis command is used to load new settings for a plugin without shutting down the entire server
(For vanilla)
spawnpoint [player] [x y z]
For example,
/spawnpoint
, sets you to spawn where you are standing, if you die
(For vanilla)
stop
For example,
/stop
, saves and shuts down the serverThis is how you should stop the server to be certain that all data is saved
You will lose data if you simply close out of the command prompt, by clicking on X
(For vanilla)
tell <player> <message>
For example,
/tell Steve my secret base is behind the waterfall
, sends a message that only Steve will be able to see.Take note that these messages will also be printed to the console
(For vanilla)
time set <day | night>
For example,
/time set day
, sets the time of the server to0
(daytime)
(For vanilla)
toggledownfall
For example,
/toggledownfall
, stops or starts rain/snowfall
(For vanilla)
tp [player] <targetplayer>
For example,
/tp Steve Codisimus
, teleports Steve to Codisimus' location
For more information regarding these and other commands please visit wiki.bukkit.org/CraftBukkit_commands. Both these commands and the property files mentioned earlier give you a lot of control over how your server functions.