Got a question that the wiki doesn't answer? Ask on the forum (preferred), or join us on IRC.

CreeperHost
About the ads

Tutorial:Setting up a Minecraft SMP server

From EngineHub.org Wiki
Jump to: navigation, search

So you want to set up a Bukkit server? Coming from hMod perhaps? This guide will tell you everything that you need to know.

Warning: This page is biased, not going to lie. However, I wouldn't be suggesting it if I didn't think it worked well.

Contents

What to know

First, using Bukkit as a server modification means that you have wide access to a number of plugins that can greatly make running a Minecraft server more fun and easier. Here are a few things to keep in mind:

  1. Bukkit is a server modification; it still runs off of Mojang's server.
  2. Bukkit isn't done yet! A lot is finished, but not quite everything.
  3. Currently, Bukkit lacks built-in permissions so you will have to install a plugin that provides permissions (more on this later).

Coming from hMod

  • Bukkit doesn't come with built-in commands of its own (like /item), so you'll have to install a plugin for that.
  • As mentioned above, you'll have to install a plugin for permissions.
  • Configuration files are now stored in plugins' folders (usually), and are now written in a format called "YAML".
  • Installing plugins is just putting the file into the right directory!

Getting Bukkit

Since Bukkit isn't done, you currently have to download "snapshots" that are created from current versions of Bukkit (as it is being developed). You have two choices:

Tip: Which one do you want? Using the bleeding edge build may be unsafe at times, but on the other hand, you'll get access to new things quicker.

Installing Bukkit

What you'll find in the download is:

  1. craftbukkit.jar — This is Bukkit
  2. plugins/scrapbukkit.jar — Some basic commands like /time
  3. plugins/chatbukkit.jar — Chat-related basic commands like /msg

We'll get into those two later plugins later, but for now, drop craftbukkit.jar into a folder. Now it's time to get it to run.

Windows users

Using Windows? Open the Notepad program and in it put:

java -Xms1024M -Xmx1024M -jar craftbukkit.jar
Tip: The number after "-Xms" indicates the amount of minimum RAM that the server will use (in megabytes). After "Xmx" is the maximum amount of RAM that the server will use. Adjust this according to your system's performance.

In Notepad, go to FileSave As and save it as run.bat in the same folder as your server files. Double click run.bat to run the server.

Linux and Mac OS X users

Open a text editor and in it put:

#!/bin/sh
java -Xms1024M -Xmx1024M -jar craftbukkit.jar
Tip: The number after "-Xms" indicates the amount of minimum RAM that the server will use (in megabytes). After "Xmx" is the maximum amount of RAM that the server will use. Adjust this according to your system's performance.

Save that file as run.sh in the same folder as the .jar that you downloaded. Now you'll have to make that run.sh file executable by entering the following in terminal:

chmod 0755 run.sh

Great! Now you can run the server with the following in terminal:

./run.sh

Configuring your server

Since Bukkit still runs Mojang's server still, server.properties will be created in the same folder as the server. Open it up and you can change various settings:

  • level-name controls the name of the world folder to use (no need to change this)
  • hellworld can be true if you want a Netherworld instead
  • spawn-monsters controls spawning of monsters like creepers
  • online-mode controls whether you want to use name verification (recommended to leave it on)
  • spawn-animals controls spawning of monsters like sheep
  • max-players is the maximum number of players
  • server-ip can be used if your computer has multiple IP addresses, allowing you to choose only one to bind to
  • pvp lets you toggle PvP
  • server-port is the server port (leave at 25565)
  • white-list lets you enable the built-in whitelist (allowing you to only let a specific list of players in)
  • spawn-protection is the size of the area around spawn to prevent non-ops from building

Restart your Minecraft server to have changes take effect.

To connect to your server, enter the IP address of your computer in Multiplayer and connect. If you are on the same computer as the server, you can enter localhost instead.

Tip: The IP address is like your street address but on the Internet. To reliably get your IP address, you can go to this site. Note that your IP address can change occasionally. You can get a free domain name (like yourserver.something.com) that will constantly point to your IP address (that's easier to give to people) by using a service like DynDNS.

What's available by default

While Bukkit doesn't have permissions yet, Mojang's server does! You can create ops by using /op YourName in the server console to make an op. Operators are a temporary thing until Bukkit gets permissions, but ops have access to the commands that come with the Minecraft server:

  • /time set <time>
  • /tp <player> <destination-player>
  • /give <player> <item> [<quantity>]
  • /save-all to save the world immediately (the world already auto-saves occasionally)
  • A bunch more commands

You'll find that some of these commands are just terrible though, so you'll want to replace some of them with a plugin.

Plugins

To install plugins, you simply drop plugin .jar files into a folder called plugins/ in the same directory as your server. That's it — when you start your server, all plugins will load.

Bundled plugins

Now remember those two plugins that came with Bukkit?

  1. plugins/scrapbukkit.jar
  2. plugins/chatbukkit.jar

You can use them, but currently their only system of permissions is ops and they won't use one of the permissions plugins (to be explained). Therefore, you probably don't want to use them. Plus, they are not particularly great in terms of flexibility as well. We'll get into what you may want as a replacement.

Recommended plugins

Permissions

For permissions, the recommended plugin that you should use is Permissions.

How permissions work in Bukkit is explained towards the end of this page.

Core functionality

Warning: I would not recommend using a "mega-plugin" for core functionality. They are inferior to their separate counterparts (go figure) and conflict with many plugins.

Protection and anti-griefing

  • WorldEdit lets you fix your world extremely easily (such as draining a griefer's lava pool with one chat command), or you can build quickly and fix your world
  • BigBrother logs all block changes by a player, allowing for rollback
  • LWC is the plugin for chest protection and locking
  • WorldGuard provides fire, lava, and area protection, and also has the largest team and oldest development history

Useful plugins

  • iChat provides chat name colors and other chat features
  • CommandHelper provides the /. command to repeat your last command and also aliases

(Note to plugin authors: PM me to get your plugin considered if you care.)

How permissions work

It's probably important that you know how permissions work with Bukkit. As previously mentioned, Bukkit does not have permissions built-in yet but plugins have come to the rescue. Thankfully, all permissions systems are fairly similar.

They all use "dotted permission trees".

  1. For example, say a plugin has pluginname.give and pluginname.give.infinite.
  2. If you give permission to pluginname.give, you actually give permission to pluginname.give.infinite as well.
  3. However, if you just give pluginname.give.infinite, then the user doesn't automatically have pluginname.give.

As you see, the power is enormous (if the plugin allows for it).

The permissions can be put into a tree (to visualize it better):

  • pluginname.give
    • pluginname.give.infinite
    • pluginname.give.stacks
  • pluginname.time
  • pluginname.teleport
    • pluginname.teleport.other

Where things differ

So here's the story: Back then, Bukkit needed permissions, so I (sk89q) explained my system to the team (the dotted nodes and whatnot), some discussion and decisions were made, and so Bukkit's permissions began. Some time later, I was casually discussing my permissions in IRC chat and Nijikokun got wind of it. He then implemented it, but since I was only casually explaining, Niji didn't get the details and so now Bukkit's permissions (which have been completed for some time but are waiting on something) and Permissions vary in the details, and the variations are considerably major.

Thus, be aware that all of your permissions are subject to change come time that Bukkit gets its permissions working.

  • In the plugins, to give access to pluginname.give.infinite automatically if you give pluginname.give, you must give pluginname.give.* (note the .*). Be aware of this! In Bukkit, this is not a requirement and ".*" will throw it off.
  • The actual permissions handling is inferior and also different to Bukkit's. Bukkit uses the order of the permissions to figure out which takes precedence. (Originally I suggested allow/deny/never flags, but we decided against them.)
  • Bukkit's permissions support multiple inheritance and other advanced features.

Plugin configuration

Configuration for plugins can usually be found at: plugins/PluginName/config.yml (not all plugins have configuration however). The format of these files is YAML, and you MUST keep these things in mind:

  • YAML does not like tabs. Only uses spaces. If you use a programming editor, configure it to use spaces.
  • YAML lets you make lists properly and such, so indentation is important. If you put - (a dash) in front of some lines, it makes a list!
  • A bad YAML file will break things badly. Use this online parser and see if it gives you errors.


Namespaces

Variants
Actions