[Unit]
Description=Minecraft Server
Requires=network.target
After=network.target

[Service]
Type=simple
NotifyAccess=main
ExecStart=/usr/bin/java ${java_opts} -jar /home/minecraft/minecraft_server.jar --nogui
Restart=always
RestartSec=10

User=minecraft
Group=minecraft

WorkingDirectory=/home/minecraft

LimitNOFILE=8192
LimitNPROC=256

UMask=0022

NoNewPrivileges=true
ProtectSystem=true
ReadOnlyPaths=/
ReadWritePaths=/home/minecraft
PrivateTmp=true
PrivateDevices=true
PrivateUsers=true
ProtectHostname=true
ProtectClock=true
ProtectKernelTunables=true
ProtectKernelModules=true
ProtectKernelLogs=true
ProtectControlGroups=true


[Install]
WantedBy=multi-user.target
