mirror of
https://github.com/itzg/docker-minecraft-server.git
synced 2024-06-07 19:40:43 +00:00
For #19: added PVP env var options
* also adding a marker env var for MCCY to reference
This commit is contained in:
parent
d4d070018a
commit
63925a794c
@ -25,9 +25,10 @@ WORKDIR /data
|
||||
|
||||
CMD [ "/start" ]
|
||||
|
||||
ENV UID 1000
|
||||
# Special marker ENV used by MCCY management tool
|
||||
ENV MC_IMAGE=YES
|
||||
|
||||
ENV UID=1000
|
||||
ENV MOTD A Minecraft Server Powered by Docker
|
||||
ENV LEVEL world
|
||||
ENV JVM_OPTS -Xmx1024M -Xms1024M
|
||||
ENV TYPE VANILLA
|
||||
ENV VERSION LATEST
|
||||
ENV TYPE=VANILLA VERSION=LATEST LEVEL=world PVP=true
|
||||
|
@ -170,6 +170,13 @@ docker run -d -e 'MOTD=My Server' ...
|
||||
If you leave it off, the last used or default message will be used. _The example shows how to specify a server
|
||||
message of the day that contains spaces by putting quotes around the whole thing._
|
||||
|
||||
### PVP Mode
|
||||
|
||||
By default servers are created with player-vs-player (PVP) mode enabled. You can disable this with the `PVP`
|
||||
environment variable set to `false`, such as
|
||||
|
||||
docker run -d -e PVP=false ...
|
||||
|
||||
### World Save Name
|
||||
|
||||
You can either switch between world saves or run multiple containers with different saves by using the `LEVEL` option,
|
||||
|
@ -84,6 +84,10 @@ if [ ! -e server.properties ]; then
|
||||
sed -i "/level-seed\s*=/ c level-seed=$SEED" /data/server.properties
|
||||
fi
|
||||
|
||||
if [ -n "$PVP" ]; then
|
||||
sed -i "/pvp\s*=/ c pvp=$PVP" /data/server.properties
|
||||
fi
|
||||
|
||||
if [ -n "$MODE" ]; then
|
||||
case ${MODE,,?} in
|
||||
0|1|2|3)
|
||||
|
Loading…
Reference in New Issue
Block a user