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 - Second Edition

You're reading from   Building Minecraft Server Modifications - Second Edition Create and customize your very own Minecraft server using Java and the Spigot API

Arrow left icon
Product type Paperback
Published in Dec 2015
Publisher
ISBN-13 9781785883026
Length 158 pages
Edition 2nd Edition
Languages
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 (12) Chapters Close

Preface 1. Deploying a Spigot Server FREE CHAPTER 2. Learning the Bukkit API 3. Creating Your First Bukkit Plugin 4. Testing on the Spigot 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

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 with world, such as world, 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: The pvp property can be set to a boolean value. PvP (short for Player versus Player) determines whether players can attack and harm each other. You will want to set this to true or false, depending on whether you want PvP to be on or off respectively.
    • difficulty=1: The difficulty property can be set to a number from 0 to 3, where 0 means Peaceful, 1 means Easy, 2 means Normal, and 3 means Hard. Everyone on the server will play at this difficulty level.
    • gamemode=0: This property determines which game mode players will start in, where 0 means Survival, 1 means Creative, and 2 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 is Bukkit plugin testing.
      Setting up a new server
    • online-mode=true: This can be set to false 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. Like server.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 to false 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 to true 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 of 16 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:
      Setting up a new server
    • 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 to 6000 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 of 72000 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 to bukkit.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.
You have been reading a chapter from
Building Minecraft Server Modifications - Second Edition - Second Edition
Published in: Dec 2015
Publisher:
ISBN-13: 9781785883026
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