mirror of
https://github.com/itzg/docker-minecraft-server.git
synced 2026-04-01 03:12:45 +00:00
Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
621962ad9c | ||
|
|
5c238af3df | ||
|
|
8e148095f0 | ||
|
|
3c55a05b1c |
@@ -61,6 +61,7 @@ ENV UID=1000 GID=1000 \
|
|||||||
JVM_XX_OPTS="-XX:+UseG1GC" MEMORY="1G" \
|
JVM_XX_OPTS="-XX:+UseG1GC" MEMORY="1G" \
|
||||||
TYPE=VANILLA VERSION=LATEST FORGEVERSION=RECOMMENDED SPONGEBRANCH=STABLE SPONGEVERSION= FABRICVERSION=LATEST LEVEL=world \
|
TYPE=VANILLA VERSION=LATEST FORGEVERSION=RECOMMENDED SPONGEBRANCH=STABLE SPONGEVERSION= FABRICVERSION=LATEST LEVEL=world \
|
||||||
PVP=true DIFFICULTY=easy ENABLE_RCON=true RCON_PORT=25575 RCON_PASSWORD=minecraft \
|
PVP=true DIFFICULTY=easy ENABLE_RCON=true RCON_PORT=25575 RCON_PASSWORD=minecraft \
|
||||||
|
RESOURCE_PACK= RESOURCE_PACK_SHA1= \
|
||||||
LEVEL_TYPE=DEFAULT GENERATOR_SETTINGS= WORLD= MODPACK= MODS= SERVER_PORT=25565 ONLINE_MODE=TRUE CONSOLE=true SERVER_NAME="Dedicated Server" \
|
LEVEL_TYPE=DEFAULT GENERATOR_SETTINGS= WORLD= MODPACK= MODS= SERVER_PORT=25565 ONLINE_MODE=TRUE CONSOLE=true SERVER_NAME="Dedicated Server" \
|
||||||
REPLACE_ENV_VARIABLES="FALSE" ENV_VARIABLE_PREFIX="CFG_"
|
REPLACE_ENV_VARIABLES="FALSE" ENV_VARIABLE_PREFIX="CFG_"
|
||||||
|
|
||||||
|
|||||||
16
README.md
16
README.md
@@ -9,6 +9,8 @@ This docker image provides a Minecraft Server that will automatically download t
|
|||||||
version at startup. You can also run/upgrade to any specific version or the
|
version at startup. You can also run/upgrade to any specific version or the
|
||||||
latest snapshot. See the *Versions* section below for more information.
|
latest snapshot. See the *Versions* section below for more information.
|
||||||
|
|
||||||
|
[](https://github.com/itzg/docker-minecraft-server/blob/master/README.md)
|
||||||
|
|
||||||
To simply use the latest stable version, run
|
To simply use the latest stable version, run
|
||||||
|
|
||||||
docker run -d -p 25565:25565 --name mc itzg/minecraft-server
|
docker run -d -p 25565:25565 --name mc itzg/minecraft-server
|
||||||
@@ -822,6 +824,12 @@ Determines if villagers will be spawned.
|
|||||||
|
|
||||||
docker run -d -e SPAWN_NPCS=true
|
docker run -d -e SPAWN_NPCS=true
|
||||||
|
|
||||||
|
### Set spawn protection
|
||||||
|
|
||||||
|
Sets the area that non-ops can not edit (0 to disable)
|
||||||
|
|
||||||
|
docker run -d -e SPAWN_PROTECTION=0
|
||||||
|
|
||||||
### View Distance
|
### View Distance
|
||||||
Sets the amount of world data the server sends the client, measured in chunks in each direction of the player (radius, not diameter).
|
Sets the amount of world data the server sends the client, measured in chunks in each direction of the player (radius, not diameter).
|
||||||
It determines the server-side viewing distance.
|
It determines the server-side viewing distance.
|
||||||
@@ -894,6 +902,14 @@ For example (just the `-e` bits):
|
|||||||
|
|
||||||
-e LEVEL_TYPE=flat -e 'GENERATOR_SETTINGS=3;minecraft:bedrock,3*minecraft:stone,52*minecraft:sandstone;2;'
|
-e LEVEL_TYPE=flat -e 'GENERATOR_SETTINGS=3;minecraft:bedrock,3*minecraft:stone,52*minecraft:sandstone;2;'
|
||||||
|
|
||||||
|
### Custom Server Resource Pack
|
||||||
|
|
||||||
|
You can set a link to a custom resource pack and set it's checksum using the `RESOURCE_PACK` and `RESOURCE_PACK_SHA1` options respectively, the default is blank:
|
||||||
|
|
||||||
|
docker run -d -e 'RESROUCE_PACK=http\://link.com/to/pack.zip?\=1' -e 'RESOURCE_PACK_SHA1=d5db29cd03a2ed055086cef9c31c252b4587d6d0'
|
||||||
|
|
||||||
|
**NOTE:** `:` and `=` must be escaped using `\`. The checksum plain-text hexadecimal.
|
||||||
|
|
||||||
### World Save Name
|
### World Save Name
|
||||||
|
|
||||||
You can either switch between world saves or run multiple containers with different saves by using the `LEVEL` option,
|
You can either switch between world saves or run multiple containers with different saves by using the `LEVEL` option,
|
||||||
|
|||||||
@@ -49,6 +49,7 @@ function customizeServerProps {
|
|||||||
setServerProp "spawn-animals" "$SPAWN_ANIMALS"
|
setServerProp "spawn-animals" "$SPAWN_ANIMALS"
|
||||||
setServerProp "spawn-monsters" "$SPAWN_MONSTERS"
|
setServerProp "spawn-monsters" "$SPAWN_MONSTERS"
|
||||||
setServerProp "spawn-npcs" "$SPAWN_NPCS"
|
setServerProp "spawn-npcs" "$SPAWN_NPCS"
|
||||||
|
setServerProp "spawn-protection" "$SPAWN_PROTECTION"
|
||||||
setServerProp "generate-structures" "$GENERATE_STRUCTURES"
|
setServerProp "generate-structures" "$GENERATE_STRUCTURES"
|
||||||
setServerProp "view-distance" "$VIEW_DISTANCE"
|
setServerProp "view-distance" "$VIEW_DISTANCE"
|
||||||
setServerProp "hardcore" "$HARDCORE"
|
setServerProp "hardcore" "$HARDCORE"
|
||||||
@@ -70,6 +71,8 @@ function customizeServerProps {
|
|||||||
setServerProp "online-mode" "$ONLINE_MODE"
|
setServerProp "online-mode" "$ONLINE_MODE"
|
||||||
setServerProp "allow-flight" "$ALLOW_FLIGHT"
|
setServerProp "allow-flight" "$ALLOW_FLIGHT"
|
||||||
setServerProp "level-type" "${LEVEL_TYPE^^}"
|
setServerProp "level-type" "${LEVEL_TYPE^^}"
|
||||||
|
setServerProp "resource-pack" "$RESOURCE_PACK"
|
||||||
|
setServerProp "resource-pack-sha1" "$RESOURCE_PACK_SHA1"
|
||||||
|
|
||||||
if [ -n "$DIFFICULTY" ]; then
|
if [ -n "$DIFFICULTY" ]; then
|
||||||
case $DIFFICULTY in
|
case $DIFFICULTY in
|
||||||
|
|||||||
@@ -2,9 +2,10 @@
|
|||||||
|
|
||||||
. /start-utils
|
. /start-utils
|
||||||
|
|
||||||
if [ -n "$OPS" -a ! -e ops.txt.converted ]; then
|
if [ -n "$OPS" ]; then
|
||||||
echo "Setting ops"
|
echo "Setting/adding ops"
|
||||||
echo $OPS | awk -v RS=, '{print}' >> ops.txt
|
rm -rf ops.txt.converted
|
||||||
|
echo $OPS | awk -v RS=, '{print}' > ops.txt
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -n "$WHITELIST" -a ! -e white-list.txt.converted ]; then
|
if [ -n "$WHITELIST" -a ! -e white-list.txt.converted ]; then
|
||||||
|
|||||||
Reference in New Issue
Block a user