官术网_书友最值得收藏!

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 spawn
    • keepInventory – Whether players will keep their items if they die
    • mobGriefing – Whether mobs such as creepers can destroy blocks
    • doFireTick – Whether fire should be spread
    • doMobLoot – Whether mobs should drop items
    • doDaylightCycle – Whether the day/night cycle is in effect
    • For 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, /plugins or /pl, displays a list of all the plugins that are installed on your server
  • (For Bukkit) reload
    • For example, /reload or /rl, disables all plugins and reenables them
    • This 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 server
    • This 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 to 0 (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.

主站蜘蛛池模板: 景东| 五大连池市| 龙泉市| 杭锦后旗| 香港| 盖州市| 武隆县| 博野县| 阳信县| 积石山| 顺义区| 涿州市| 孝义市| 白银市| 兴海县| 萝北县| 交城县| 拜城县| 温宿县| 张掖市| 台前县| 连平县| 磴口县| 冕宁县| 永靖县| 宁海县| 永胜县| 高邑县| 峡江县| 息烽县| 称多县| 盐城市| 安福县| 方正县| 太白县| 个旧市| 长垣县| 新建县| 长垣县| 繁峙县| 长寿区|