Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Building Minecraft Server Modifications

You're reading from   Building Minecraft Server Modifications Discover how to program your own server plugins and augment your Minecraft server with Bukkit

Arrow left icon
Product type Paperback
Published in Sep 2013
Publisher Packt
ISBN-13 9781849696005
Length 142 pages
Edition 1st Edition
Languages
Concepts
Arrow right icon
Author (1):
Arrow left icon
Cody M. Sommer Cody M. Sommer
Author Profile Icon Cody M. Sommer
Cody M. Sommer
Arrow right icon
View More author details
Toc

Table of Contents (17) Chapters Close

Building Minecraft Server Modifications
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
1. Deploying a CraftBukkit Server FREE CHAPTER 2. Learning the Bukkit API 3. Creating Your First Bukkit Plugin 4. Testing on the CraftBukkit Server 5. Plugin Commands 6. Player Permissions 7. The Bukkit Event System 8. Making Your Plugin Configurable 9. Saving Your Data 10. The Bukkit Scheduler Index

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.

You have been reading a chapter from
Building Minecraft Server Modifications
Published in: Sep 2013
Publisher: Packt
ISBN-13: 9781849696005
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Banner background image