Tutorial:Setting up a Minecraft SMP server
So you want to set up a Bukkit server? Coming from hMod perhaps? This guide will tell you everything that you need to know.
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:
- Bukkit is a server modification; it still runs off of Mojang's server.
- Bukkit isn't done yet! A lot is finished, but not quite everything.
- 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!
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:
What you'll find in the download is:
- craftbukkit.jar — This is Bukkit
- plugins/scrapbukkit.jar — Some basic commands like /time
- 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.
Using Windows? Open the Notepad program and in it put:
java -Xms1024M -Xmx1024M -jar craftbukkit.jar
In Notepad, go to File → Save 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
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:
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.
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-allto 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.
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.
Now remember those two plugins that came with Bukkit?
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.
For permissions, the recommended plugin that you should use is Permissions.
How permissions work in Bukkit is explained towards the end of this page.
- CommandBook has likely the best basic commands (/item, /time, /tp, etc.)
- MyWarp provides warps
- MyHome provides homes (per-user /home warps)
- For bans, you can use either MCBans (with global ban support) or KiwiAdmin (note: vanilla Minecraft server comes with bans, but only ops can use it)
- For a whitelist, Minecraft server comes with one but you can also use Whitelist
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
- 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".
- For example, say a plugin has pluginname.give and pluginname.give.infinite.
- If you give permission to pluginname.give, you actually give permission to pluginname.give.infinite as well.
- 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):
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.
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.