Setting up a new server
You will see the server folder populated with several files and folders. The purpose of some of these are explained in this section, but most of the files should not concern you at present:
plugins
: This folder is where you will place all the Bukkit plugins that you wish to use on the server.world
: The folders that begin withworld
, such asworld
,world_nether
, and so on, include all the information for the new world of the server. If you already have a Minecraft world that you wish to use, then replace these new folders with the old world folders. Do not attempt to do this while the server is running as it will cause problems.server.properties
: This file holds several options that allow you to change how a Minecraft server operates. You can open it with a text editor. There are many settings, and most of them are pretty self-explanatory. I will go over a few settings in the following list that you may want to modify. For a full list of property explanations, you can visit www.minecraftwiki.net/wiki/Server.properties. Changing any of these settings will require you to restart the server.pvp=true
: Thepvp
property can be set to aboolean
value. PvP (short for Player versus Player) determines whether players can attack and harm each other. You will want to set this totrue
orfalse
, depending on whether you want PvP to be on or off respectively.difficulty=1
: The difficulty property can be set to a number from0
to3
, where0
means Peaceful,1
means Easy,2
means Normal, and3
means Hard. Everyone on the server will play at this difficulty level.gamemode=0
: This property determines which game mode players will start in, where0
means Survival,1
means Creative, and2
means Adventure.motd=A Minecraft Server
: MOTD (short for Message Of The Day. This message will be displayed when viewing your server in the Minecraft multiplayer server list, as shown in the following screenshot. It is a good idea to set this to a short description of your server. An example of this isBukkit plugin testing
.online-mode=true
: This can be set tofalse
to allow players to connect to the server when in the offline mode. This is useful in case http://minecraft.net/ is unavailable or your computer is not connected to the Internet. Running your server in the offline mode can cause security issues, such as other players logging in to your account.
bukkit.yml
: This file contains many server options. These are the options that a vanilla server does not offer and are only available when you run a modified server. Note that this file is a YMAL (.yml
) file and not a PROPERTIES (.properties
) file. When you open it, you will see how the two file types are formatted differently. The first difference that you will see is that certain lines are indented. You do not need to fully understand the YMAL formatting, as it will be explained further as we progress through creating Bukkit plugins. There are a few settings in this file that I will bring to your attention, as shown in the following list. For a full list of these Bukkit settings, you can visit wiki.bukkit.org/Bukkit.yml. Likeserver.properties
, changing any of these settings will require you to restart the server.allow-end: true
: A vanilla Minecraft server allows you to disable the nether world from functioning. A Bukkit server allows you to disable the end world as well. Set this tofalse
to prevent players from traveling to the end.use-exact-login-location: false
: Vanilla Minecraft contains a feature that will prevent players from spawning inside a block. The player will instead be spawned above the block so that they will not be stuck when they join the server. This can be easily exploited to climb onto blocks that a player could normally not reach. Bukkit can prevent this from occurring by spawning the player exactly where they logged out. Set this property totrue
if you wish to prevent this.spawn-limits
: Bukkit allows a server admin to modify the number of monsters and animals that are allowed to spawn within a given chunk. If you are unfamiliar with the term chunk, it is a group of16 x 16
blocks from bedrock to the highest point of the sky. The following is a picture of a single chunk in Minecraft; if you feel that there are too many (or too few) mobs, then you will want to adjust these values accordingly:ticks-per: autosave: 0
: Unlike vanilla Minecraft, a Bukkit server will not periodically save your player/world data. Automatically saving data may prevent the server from losing the changes that were made in the game in case it crashes or shuts down for some reason, such as the computer losing power. Vanilla has set this to6000
by default. This value is provided in ticks. There are 20 ticks every second. We can determine how long 6,000 ticks is with this math: 6000 ticks / 20 ticks/second = 300 seconds and 300 seconds / 60 seconds/minute = 5 minutes. From this calculation, you should be able to calculate an appropriate time period after which you want your server to autosave your progress. If your server lags whenever it saves your changes, then you may want to increase this number. A setting of72000
will cause a lag only once every hour. However, if the server crashes right before it saves, you may lose any progress that you made in the past hour.
spigot.yml:
This file is similar tobukkit.yml
. It has many settings and configurations that are only available when running a Spigot server. If you wish to configure any of these options, refer to the documentation at the top of the file.