UP  |  HOME

Minecraft Spigot Server

Get a basic debian setup and install git, build-essential, and default-jre-headless.

https://www.spigotmc.org/wiki/spigot-installation/

Create a minecraft user/group. Enter blank passwords, shouldn't need to login directly

adduser minecraft
mkdir -p /var/minecraft/build
chown -R minecraft:minecraft /var/minecraft

Download spigotmc buildtool and run it to fetch/build latest version.
https://www.spigotmc.org/wiki/buildtools/

cd /var/minecraft/build
wget <url for>/BuildTools.jar
java -jar BuildTools.jar

For a specific spigotmc version or latest

java -jar BuildTools.jar --rev 1.14.4
java -jar BuildTools.jar --rev latest

Build mcrcon

git clone git://git.code.sf.net/p/mcrcon/code mcrcon
gcc mcrcon.c -o mcrcon

Copy binaries to runtime location.

cp /var/minecraft/build/spigot/spigot-1.13.2.jar /var/minecraft/server/spigot.jar
cp /var/minecraft/build/mcrcon/mcrcon /var/minecraft/server/

Server configuration:

Listing 1: server.properties
spawn-protection=16
max-tick-time=60000
generator-settings=
force-gamemode=false
allow-nether=true
enforce-whitelist=true
gamemode=0
broadcast-console-to-ops=true
enable-query=true
player-idle-timeout=0
difficulty=1
spawn-monsters=true
broadcast-rcon-to-ops=true
admin-slot=true
op-permission-level=4
pvp=true
snooper-enabled=true
level-type=DEFAULT
hardcore=false
enable-command-block=false
max-players=30
network-compression-threshold=256
resource-pack-sha1=
max-world-size=29999984
spawn-monster=true
debug=false
texture-pack=
spawn-npcs=true
allow-flight=false
level-name=world
view-distance=10
resource-pack=
spawn-animals=true
white-list=true
generate-structures=true
online-mode=true
max-build-height=256
use-native-transport=true
prevent-proxy-connections=false
enable-rcon=true
level-seed=sweetiezilla
motd=Sparky
server-name=Shadow Elmo Home Server
rcon.port=45892
query.port=25565
server-port=25565
rcon.password=<rcon-password>
server-ip=<addr>
Listing 2: bukkit.yml
settings:
  allow-end: true
  warn-on-overload: true
  permissions-file: permissions.yml
  update-folder: update
  plugin-profiling: false
  connection-throttle: 4000
  query-plugins: true
  deprecated-verbose: default
  shutdown-message: Server closed
spawn-limits:
  monsters: 70
  animals: 10
  water-animals: 15
  ambient: 15
chunk-gc:
  period-in-ticks: 600
  load-threshold: 0
ticks-per:
  animal-spawns: 400
  monster-spawns: 1
  autosave: 6000
aliases: now-in-commands.yml
Listing 3: spigot.yml
config-version: 11
settings:
  save-user-cache-on-stop-only: false
  bungeecord: false
  late-bind: false
  sample-count: 12
  player-shuffle: 0
  user-cache-size: 1000
  moved-wrongly-threshold: 0.0625
  moved-too-quickly-multiplier: 10.0
  timeout-time: 60
  restart-on-crash: true
  restart-script: ./start.sh
  netty-threads: 4
  attribute:
    maxHealth:
      max: 2048.0
    movementSpeed:
      max: 2048.0
    attackDamage:
      max: 2048.0
  debug: false
messages:
  whitelist: You are not whitelisted on this server!
  unknown-command: Unknown command. Type "/help" for help.
  server-full: The server is full!
  outdated-client: Outdated client! Please use {0}
  outdated-server: Outdated server! I'm still on {0}
  restart: Server is restarting
stats:
  disable-saving: false
  forced-stats: {}
commands:
  log: true
  tab-complete: 0
  send-namespaced: true
  spam-exclusions:
  - /skill
  silent-commandblock-console: false
  replace-commands:
  - setblock
  - summon
  - testforblock
  - tellraw
advancements:
  disable-saving: false
  disabled:
  - minecraft:story/disabled
world-settings:
  default:
    verbose: true
    growth:
      beetroot-modifier: 100
      carrot-modifier: 100
      potato-modifier: 100
      cactus-modifier: 100
      cane-modifier: 100
      melon-modifier: 100
      mushroom-modifier: 100
      pumpkin-modifier: 100
      sapling-modifier: 100
      wheat-modifier: 100
      netherwart-modifier: 100
      vine-modifier: 100
      cocoa-modifier: 100
    entity-activation-range:
      animals: 32
      monsters: 32
      misc: 16
      tick-inactive-villagers: true
    entity-tracking-range:
      players: 48
      animals: 48
      monsters: 48
      misc: 32
      other: 64
    ticks-per:
      hopper-transfer: 8
      hopper-check: 1
    hopper-amount: 1
    random-light-updates: false
    mob-spawn-range: 6
    dragon-death-sound-radius: 0
    seed-village: 10387312
    seed-desert: 14357617
    seed-igloo: 14357618
    seed-jungle: 14357619
    seed-swamp: 14357620
    seed-monument: 10387313
    seed-shipwreck: 165745295
    seed-ocean: 14357621
    seed-slime: 987234911
    hunger:
      jump-walk-exhaustion: 0.05
      jump-sprint-exhaustion: 0.2
      combat-exhaustion: 0.1
      regen-exhaustion: 6.0
      swim-multiplier: 0.01
      sprint-multiplier: 0.1
      other-multiplier: 0.0
    max-tnt-per-tick: 100
    max-tick-time:
      tile: 50
      entity: 50
    squid-spawn-range:
      min: 45.0
    zombie-aggressive-towards-villager: true
    merge-radius:
      exp: 3.0
      item: 2.5
    enable-zombie-pigmen-portal-spawns: true
    item-despawn-rate: 6000
    arrow-despawn-rate: 1200
    nerf-spawner-mobs: false
    wither-spawn-sound-radius: 0
    view-distance: 10
    hanging-tick-frequency: 100
Listing 4: /etc/systemd/system/minecraft.service
[Unit]
Description=Minecraft Server
Documentation=

Wants=network.target
After=network.target

[Service]
User=minecraft
Group=minecraft
Nice=5
KillMode=none
SuccessExitStatus=0 1 255

ProtectHome=true
ProtectSystem=full
PrivateDevices=true
NoNewPrivileges=true
PrivateTmp=true
InaccessibleDirectories=/root /sys /srv -/opt /media -/lost+found
ReadWriteDirectories=/var/minecraft/server
WorkingDirectory=/var/minecraft/server
ExecStart=/usr/bin/java -Xmx4096M -Xms4096M -jar spigot.jar --noconsole
ExecStop=/var/minecraft/mcrcon -H <addr> -P 45892 -p <rcon-password>

[Install]
WantedBy=multi-user.target

Set up systemd unit to autorun server.

Install plugins. (Maps, anti-xray, teleport)