├── .dccache ├── .github ├── FUNDING.yml └── workflows │ └── auto-assign-issue.yml ├── CODE_OF_CONDUCT.md ├── CONTRIBUTING.md ├── LICENSE ├── README.md ├── amd64.Dockerfile ├── arm64v8.Dockerfile ├── armv7.Dockerfile ├── bukkit.yml ├── config.yml ├── docker-compose.yml ├── hooks ├── post_push └── pre_build ├── kubernetes ├── 01-namespace.yaml ├── 02-pvc.yaml ├── 03-deployment.yaml └── 04-service.yaml ├── multi-arch-manifest.yaml ├── paper-global.yml ├── ppc64le.Dockerfile ├── riscv64.Dockerfile ├── s390x.Dockerfile ├── server.properties ├── spigot.yml └── start.sh /.dccache: -------------------------------------------------------------------------------- 1 | {} -------------------------------------------------------------------------------- /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | github: [TheRemote] 2 | -------------------------------------------------------------------------------- /.github/workflows/auto-assign-issue.yml: -------------------------------------------------------------------------------- 1 | name: Issue assignment 2 | 3 | on: 4 | issues: 5 | types: [opened] 6 | 7 | jobs: 8 | auto-assign: 9 | runs-on: ubuntu-latest 10 | steps: 11 | - name: 'Auto-assign issue' 12 | uses: pozil/auto-assign-issue@v1 13 | with: 14 | repo-token: ${{ secrets.GITHUB_TOKEN }} 15 | assignees: TheRemote 16 | -------------------------------------------------------------------------------- /CODE_OF_CONDUCT.md: -------------------------------------------------------------------------------- 1 | # Contributor Covenant Code of Conduct 2 | 3 | ## Our Pledge 4 | 5 | We as members, contributors, and leaders pledge to make participation in our 6 | community a harassment-free experience for everyone, regardless of age, body 7 | size, visible or invisible disability, ethnicity, sex characteristics, gender 8 | identity and expression, level of experience, education, socio-economic status, 9 | nationality, personal appearance, race, religion, or sexual identity 10 | and orientation. 11 | 12 | We pledge to act and interact in ways that contribute to an open, welcoming, 13 | diverse, inclusive, and healthy community. 14 | 15 | ## Our Standards 16 | 17 | Examples of behavior that contributes to a positive environment for our 18 | community include: 19 | 20 | * Demonstrating empathy and kindness toward other people 21 | * Being respectful of differing opinions, viewpoints, and experiences 22 | * Giving and gracefully accepting constructive feedback 23 | * Accepting responsibility and apologizing to those affected by our mistakes, 24 | and learning from the experience 25 | * Focusing on what is best not just for us as individuals, but for the 26 | overall community 27 | 28 | Examples of unacceptable behavior include: 29 | 30 | * The use of sexualized language or imagery, and sexual attention or 31 | advances of any kind 32 | * Trolling, insulting or derogatory comments, and personal or political attacks 33 | * Public or private harassment 34 | * Publishing others' private information, such as a physical or email 35 | address, without their explicit permission 36 | * Other conduct which could reasonably be considered inappropriate in a 37 | professional setting 38 | 39 | ## Enforcement Responsibilities 40 | 41 | Community leaders are responsible for clarifying and enforcing our standards of 42 | acceptable behavior and will take appropriate and fair corrective action in 43 | response to any behavior that they deem inappropriate, threatening, offensive, 44 | or harmful. 45 | 46 | Community leaders have the right and responsibility to remove, edit, or reject 47 | comments, commits, code, wiki edits, issues, and other contributions that are 48 | not aligned to this Code of Conduct, and will communicate reasons for moderation 49 | decisions when appropriate. 50 | 51 | ## Scope 52 | 53 | This Code of Conduct applies within all community spaces, and also applies when 54 | an individual is officially representing the community in public spaces. 55 | Examples of representing our community include using an official e-mail address, 56 | posting via an official social media account, or acting as an appointed 57 | representative at an online or offline event. 58 | 59 | ## Enforcement 60 | 61 | Instances of abusive, harassing, or otherwise unacceptable behavior may be 62 | reported to the community leaders responsible for enforcement at 63 | 05jchambers@gmail.com. 64 | All complaints will be reviewed and investigated promptly and fairly. 65 | 66 | All community leaders are obligated to respect the privacy and security of the 67 | reporter of any incident. 68 | 69 | ## Enforcement Guidelines 70 | 71 | Community leaders will follow these Community Impact Guidelines in determining 72 | the consequences for any action they deem in violation of this Code of Conduct: 73 | 74 | ### 1. Correction 75 | 76 | **Community Impact**: Use of inappropriate language or other behavior deemed 77 | unprofessional or unwelcome in the community. 78 | 79 | **Consequence**: A private, written warning from community leaders, providing 80 | clarity around the nature of the violation and an explanation of why the 81 | behavior was inappropriate. A public apology may be requested. 82 | 83 | ### 2. Warning 84 | 85 | **Community Impact**: A violation through a single incident or series 86 | of actions. 87 | 88 | **Consequence**: A warning with consequences for continued behavior. No 89 | interaction with the people involved, including unsolicited interaction with 90 | those enforcing the Code of Conduct, for a specified period of time. This 91 | includes avoiding interactions in community spaces as well as external channels 92 | like social media. Violating these terms may lead to a temporary or 93 | permanent ban. 94 | 95 | ### 3. Temporary Ban 96 | 97 | **Community Impact**: A serious violation of community standards, including 98 | sustained inappropriate behavior. 99 | 100 | **Consequence**: A temporary ban from any sort of interaction or public 101 | communication with the community for a specified period of time. No public or 102 | private interaction with the people involved, including unsolicited interaction 103 | with those enforcing the Code of Conduct, is allowed during this period. 104 | Violating these terms may lead to a permanent ban. 105 | 106 | ### 4. Permanent Ban 107 | 108 | **Community Impact**: Demonstrating a pattern of violation of community 109 | standards, including sustained inappropriate behavior, harassment of an 110 | individual, or aggression toward or disparagement of classes of individuals. 111 | 112 | **Consequence**: A permanent ban from any sort of public interaction within 113 | the community. 114 | 115 | ## Attribution 116 | 117 | This Code of Conduct is adapted from the [Contributor Covenant][homepage], 118 | version 2.0, available at 119 | https://www.contributor-covenant.org/version/2/0/code_of_conduct.html. 120 | 121 | Community Impact Guidelines were inspired by [Mozilla's code of conduct 122 | enforcement ladder](https://github.com/mozilla/diversity). 123 | 124 | [homepage]: https://www.contributor-covenant.org 125 | 126 | For answers to common questions about this code of conduct, see the FAQ at 127 | https://www.contributor-covenant.org/faq. Translations are available at 128 | https://www.contributor-covenant.org/translations. 129 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Contributing 2 | 3 | Hello! Everyone is welcome to contribute to the project. That could include reporting issues, pull requests, fixing bugs, writing documentation, translations, anything! 4 | 5 | ## Looking for support? 6 | 7 | The best places to get support are the project's issues section or my blog's comments section. 8 | 9 | ## How to report a bug 10 | 11 | Think you found a bug? Please check the list of open issues to see if your bug has already been reported. If it hasn't please submit a new issue. 12 | 13 | Here are a few tips for writing *great* bug reports: 14 | 15 | * Describe the specific problem (e.g., "server won't load and log files are showing this specific crash" versus "getting an error") 16 | * Include the steps to reproduce the bug, what you expected to happen, and what happened instead 17 | * Check that you are using the latest version of the project and its dependencies 18 | * Include what version of the project your using, as well as any relevant dependencies 19 | * Only include one bug per issue. If you have discovered two bugs, please file two issues 20 | * Even if you don't know how to fix the bug, including a failing test may help others track it down 21 | * Always include error output and log files when possible 22 | 23 | ## How to suggest a feature or enhancement 24 | 25 | Feature requests are welcome. But take a moment to find out whether your idea fits with the scope and goals of the project. Sometimes it makes more sense to fork the project if it's beyond the scope of this specific project. 26 | 27 | Open an issue which describes the feature you would like to see, why you want it, how it should work, etc. 28 | 29 | ## How to propose changes 30 | 31 | Here's a few general guidelines for proposing changes: 32 | 33 | * Each pull request should implement **one** feature or bug fix. If you want to add or fix more than one thing, submit more than one pull request 34 | * Do not commit changes to files that are irrelevant to your feature or bug fix 35 | * Write a good commit message describing what you are changing and why 36 | 37 | At a high level, [the process for proposing changes](https://guides.github.com/introduction/flow/) is: 38 | 39 | 1. Fork and clone the project 40 | 2. Make your change, add tests, and make sure the tests still pass 41 | 3. Push to your fork and submit a pull request 42 | 4. Pat your self on the back and wait for your pull request to be reviewed and merged 43 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2022 James A. Chambers 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Legendary Java Minecraft + Geyser + Floodgate + Paper Dedicated Server for Docker 2 | Legendary Minecraft Geyser Container 3 | 4 | This is the Docker containerized version of my Minecraft Java Paper Dedicated Server for Linux/Raspberry Pi scripts but with Geyser and Floodgate included. 5 | 6 | Geyser and Floodgate allow Minecraft Bedrock players to join your Java server! 7 | 8 | My main blog article (and the best place for support) is here.
9 | The version without Floodgate and Geyser is here.
10 | The official GitHub repository is located here.
11 | The official Docker Hub repository is located here.
12 |
13 | The Bedrock version of the Docker container is available here. This is for Java Minecraft but Bedrock players can connect to it.
14 | 15 |

Features

16 | 28 | 29 | 30 |

Docker Usage

31 | First you must create a named Docker volume. This can be done with:
32 |
docker volume create yourvolumename
33 | 34 | Now you may launch the server and open the ports necessary with one of the following Docker launch commands:
35 |
36 | With default ports: 37 |
docker run -it -v yourvolumename:/minecraft -p 25565:25565 -p 19132:19132/udp -p 19132:19132 --restart unless-stopped 05jchambers/legendary-minecraft-geyser-floodgate:latest
38 | With custom ports (this example uses 12345 for the Java port and 54321 for the Bedrock port): 39 |
docker run -it -v yourvolumename:/minecraft -p 12345:12345 -e Port=12345 -p 54321:54321/udp -p 54321:54321 -e BedrockPort=54321 --restart unless-stopped 05jchambers/legendary-minecraft-geyser-floodgate:latest
40 | With a custom Minecraft version (add -e Version=1.X.X, must be present on Paper's API servers to work): 41 |
docker run -it -v yourvolumename:/minecraft -p 25565:25565 -p 19132:19132/udp -p 19132:19132 -e Version=1.17.1 --restart unless-stopped 05jchambers/legendary-minecraft-geyser-floodgate:latest
42 | With a maximum memory limit in megabytes (optional, prevents crashes on platforms with limited memory, -e MaxMemory=2048): 43 |
docker run -it -v yourvolumename:/minecraft -p 25565:25565 -p 19132:19132/udp -p 19132:19132 -e MaxMemory=2048 --restart unless-stopped 05jchambers/legendary-minecraft-geyser-floodgate:latest
44 | Using a different timezone: 45 |
docker run -it -v yourvolumename:/minecraft -p 25565:25565 -p 19132:19132/udp -p 19132:19132 -e TZ="America/Denver" --restart unless-stopped 05jchambers/legendary-minecraft-geyser-floodgate:latest
46 | Skipping backups on certain folders (comma separated): 47 |
docker run -it -v yourvolumename:/minecraft -p 25565:25565 -p 19132:19132/udp -p 19132:19132 -e NoBackup="plugins/ftp,plugins/test2" --restart unless-stopped 05jchambers/legendary-minecraft-geyser-floodgate:latest
48 | Skipping permissions check: 49 |
docker run -it -v yourvolumename:/minecraft -p 25565:25565 -p 19132:19132/udp -p 19132:19132 -e NoPermCheck="Y" --restart unless-stopped 05jchambers/legendary-minecraft-geyser-floodgate:latest
50 | 51 |

Kubernetes Usage

52 | First you must create a suitable PVC using your preferred StorageClass.
53 | To run within Kubernetes, you must pass the enviroment variable `k8s="True"` 54 | alongside any others you require:
55 |
 56 |         env:
 57 |         - name: MaxMemory
 58 |           value: '1024'
 59 |         - name: TZ
 60 |           value: Europe/London
 61 |         - name: k8s
 62 |           value: "True"
 63 | 
64 | Be aware that terminal features will not be available when running in kubernetes 65 |
66 | The pod can be exposed using a LoadBalancer or TCP/UDP Ingress service. See example manifests in the /kubernetes folder of the repo. The examples are based on Longhorn 67 | storage backend and a LoadBalancer service - these will need altering to be suitable 68 | for your environment.
69 | 70 |

Configuration / Accessing Server Files

71 | The server data is stored where Docker stores your volumes. This is typically a folder on the host OS that is shared and mounted with the container.
72 | You can find your exact path by typing:
docker volume inspect yourvolumename
This will give you the fully qualified path to your volume like this: 73 |
{
 74 |         "CreatedAt": "2022-05-09T21:08:34-06:00",
 75 |         "Driver": "local",
 76 |         "Labels": {},
 77 |         "Mountpoint": "/var/lib/docker/volumes/yourvolumename/_data",
 78 |         "Name": "yourvolumename",
 79 |         "Options": {},
 80 |         "Scope": "local"
 81 |     }
82 |
83 | On Linux it's typically available at:
/var/lib/docker/volumes/yourvolumename/_data

84 | On Windows it's at
C:\ProgramData\DockerDesktop
but may be located at something more like
\wsl$\docker-desktop-data\version-pack-data\community\docker\volumes\
if you are using WSL (Windows Subsystem for Linux
85 |
86 | On Mac it's typically
~/Library/Containers/com.docker.docker/Data/vms/0/

87 | If you are using Docker Desktop on Mac then you need to access the Docker VM with the following command first: 88 |
screen ~/Library/Containers/com.docker.docker/Data/com.docker.driver.amd64-linux/tty
89 | You can then normally access the Docker volumes using the path you found in the first step with docker volume inspect

90 | Most people will want to edit server.properties. You can make the changes to the file and then restart the container to make them effective.
91 |
92 | Backups are stored in the "backups" folder
93 |
94 | The Geyser configuration is located in plugins/Geyser-Spigot/config.yml
95 | The Floodgate configuration is located in plugins/floodgate/config.yml
96 | 97 |

TZ (timezone) Environment Variable

98 | You can change the timezone from the default "America/Denver" to own timezone using this environment variable:
docker run -it -v yourvolumename:/minecraft -p 25565:25565 -p 19132:19132/udp -p 19132:19132 -e TZ="America/Denver" --restart unless-stopped 05jchambers/legendary-minecraft-geyser-floodgate:latest
99 | A list of Linux timezones is available here 100 | 101 |

BackupCount Environment Variable

102 | By default the server keeps 10 rolling backups that occur each time the container restarts. You can override this using the BackupCount environment variable:
docker run -it -v yourvolumename:/minecraft -p 25565:25565 -p 19132:19132/udp -p 19132:19132 -e BackupCount=20 --restart unless-stopped 05jchambers/legendary-minecraft-geyser-floodgate:latest
103 | 104 |

QuietCurl Environment Variable

105 | You can use the QuietCurl environment variable to suppress curl's download output. This will keep your logs tidier but may make it harder to diagnose if something is going wrong. If things are working well it's safe to enable this option and turn it back off so you can see the output if you need to:
docker run -it -v yourvolumename:/minecraft -p 25565:25565 -p 19132:19132/udp -p 19132:19132 -e QuietCurl=Y --restart unless-stopped 05jchambers/legendary-minecraft-geyser-floodgate:latest
106 | 107 |

Plugins

108 | This is a "Paper" Minecraft server which has plugin compatibility with Paper / Spigot / Bukkit.
109 |
110 | Installation is simple. There is a "plugins" folder on your Docker named volume.
111 |
112 | Navigate to your server files on your host operating system (see accessing server files section if you don't know where this is) and you will see the "plugins" folder.
113 |
114 | You just need to drop the extracted version of the plugin (a .jar file) into this folder and restart the container. That's it!
115 |
116 | Some plugins have dependencies so make sure you read the installation guide first for the plugin you are looking at.
117 | A popular place to get plugins is: https://dev.bukkit.org/bukkit-plugins 118 | 119 |

Troubleshooting Note - Oracle Virtual Machines

120 | A very common problem people have with the Oracle Virtual Machine tutorials out there that typically show you how to use a free VM is that the VM is much more difficult to configure than just about any other product / offering out there.
121 | The symptom you will have is that nobody will be able to connect.
122 | It is because there are several steps you need to take to open the ports on the Oracle VM. You need to both:
123 |
127 | Both of these settings are typically required before you will be able to connect to your VM instance. This is purely configuration related and has nothing to do with the script or the Minecraft server itself.

128 | I do not recommend this platform due to the configuration difficulty but the people who have gone through the pain of configuring an Oracle VM have had good experiences with it after that point. Just keep in mind it's going to be a rough ride through the configuration for most people.

129 | Here are some additional links:
130 | 136 | 137 |

Troubleshooting Note - Hyper-V

138 | There is a weird bug in Hyper-V that breaks UDP connections on the Minecraft server. There are two fixes for this. The simplest fix is that you have to use a Generation 1 VM with the Legacy LAN network driver.
139 | See the following links:
140 | 144 | There is a second fix that was shared by bpsimons here.
You need to install ethtool first with sudo apt install ethtool. Next in your /etc/network/interfaces file add "offload-tx off" to the bottom as the issue appears to be with TX offloading.
145 | Here's an example:
# The primary network interface
146 | auto eth0
147 | iface eth0 inet static
148 | address 192.168.1.5
149 | netmask 255.255.255.0
150 | network 192.168.1.0
151 | broadcast 192.168.1.255
152 | gateway 192.168.1.1
153 | offload-tx off
154 | This can also be done non-persistently with the following ethtool command:
ethtool -K eth0 tx off
155 | 156 |

Buy A Coffee / Donate

157 |

People have expressed some interest in this (you are all saints, thank you, truly)

158 | 164 | 165 |

Update History

166 | 319 | -------------------------------------------------------------------------------- /amd64.Dockerfile: -------------------------------------------------------------------------------- 1 | # Minecraft Java Paper Server + Geyser + Floodgate Docker Container 2 | # Author: James A. Chambers - https://jamesachambers.com/minecraft-java-bedrock-server-together-geyser-floodgate/ 3 | # GitHub Repository: https://github.com/TheRemote/Legendary-Java-Minecraft-Geyser-Floodgate 4 | 5 | # Use Ubuntu rolling version for builder 6 | FROM ubuntu:rolling AS builder 7 | 8 | # Update apt 9 | RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install qemu-user-static binfmt-support apt-utils -yqq && rm -rf /var/cache/apt/* 10 | 11 | # Use Ubuntu rolling version 12 | FROM --platform=linux/amd64 ubuntu:rolling 13 | 14 | # Fetch dependencies 15 | RUN apt update && DEBIAN_FRONTEND=noninteractive apt-get install openjdk-21-jre-headless tzdata sudo curl unzip net-tools gawk openssl findutils pigz libcurl4 libc6 libcrypt1 apt-utils libcurl4-openssl-dev ca-certificates binfmt-support nano -yqq && rm -rf /var/cache/apt/* 16 | 17 | # Set port environment variable 18 | ENV Port=25565 19 | 20 | # Set Bedrock port environment variable 21 | ENV BedrockPort=19132 22 | 23 | # Optional maximum memory Minecraft is allowed to use 24 | ENV MaxMemory= 25 | 26 | # Optional Paper Minecraft Version override 27 | ENV Version="1.21.4" 28 | 29 | # Optional Timezone 30 | ENV TZ="America/Denver" 31 | 32 | # Optional folder to ignore during backup operations 33 | ENV NoBackup="" 34 | 35 | # Number of rolling backups to keep 36 | ENV BackupCount=10 37 | 38 | # Optional switch to skip permissions check 39 | ENV NoPermCheck="" 40 | 41 | # Optional switch to tell curl to suppress the progress meter which generates much less noise in the logs 42 | ENV QuietCurl="" 43 | 44 | # Optional switch to disable ViaVersion 45 | ENV NoViaVersion="" 46 | 47 | # IPV4 Ports 48 | EXPOSE 25565/tcp 49 | EXPOSE 19132/tcp 50 | EXPOSE 19132/udp 51 | 52 | # Copy scripts to minecraftbe folder and make them executable 53 | RUN mkdir /scripts 54 | COPY *.sh /scripts/ 55 | COPY *.yml /scripts/ 56 | COPY server.properties /scripts/ 57 | RUN chmod -R +x /scripts/*.sh 58 | 59 | # Set entrypoint to start.sh script 60 | ENTRYPOINT ["/bin/bash", "/scripts/start.sh"] 61 | -------------------------------------------------------------------------------- /arm64v8.Dockerfile: -------------------------------------------------------------------------------- 1 | # Minecraft Java Paper Server + Geyser + Floodgate Docker Container 2 | # Author: James A. Chambers - https://jamesachambers.com/minecraft-java-bedrock-server-together-geyser-floodgate/ 3 | # GitHub Repository: https://github.com/TheRemote/Legendary-Java-Minecraft-Geyser-Floodgate 4 | 5 | # Use Ubuntu rolling version for builder 6 | FROM ubuntu:rolling AS builder 7 | 8 | # Update apt 9 | RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install qemu-user-static binfmt-support apt-utils -yqq && rm -rf /var/cache/apt/* 10 | 11 | # Use Ubuntu rolling version 12 | FROM --platform=linux/arm64/v8 ubuntu:rolling 13 | 14 | # Add QEMU 15 | COPY --from=builder /usr/bin/qemu-aarch64-static /usr/bin/ 16 | 17 | # Fetch dependencies 18 | RUN apt update && DEBIAN_FRONTEND=noninteractive apt-get install openjdk-21-jre-headless tzdata sudo curl unzip net-tools gawk openssl findutils pigz libcurl4 libc6 libcrypt1 apt-utils libcurl4-openssl-dev ca-certificates binfmt-support nano -yqq && rm -rf /var/cache/apt/* 19 | 20 | # Set port environment variable 21 | ENV Port=25565 22 | 23 | # Set Bedrock port environment variable 24 | ENV BedrockPort=19132 25 | 26 | # Optional maximum memory Minecraft is allowed to use 27 | ENV MaxMemory= 28 | 29 | # Optional Paper Minecraft Version override 30 | ENV Version="1.21.4" 31 | 32 | # Optional Timezone 33 | ENV TZ="America/Denver" 34 | 35 | # Optional folder to ignore during backup operations 36 | ENV NoBackup="" 37 | 38 | # Number of rolling backups to keep 39 | ENV BackupCount=10 40 | 41 | # Optional switch to skip permissions check 42 | ENV NoPermCheck="" 43 | 44 | # Optional switch to tell curl to suppress the progress meter which generates much less noise in the logs 45 | ENV QuietCurl="" 46 | 47 | # Optional switch to disable ViaVersion 48 | ENV NoViaVersion="" 49 | 50 | # IPV4 Ports 51 | EXPOSE 25565/tcp 52 | EXPOSE 19132/tcp 53 | EXPOSE 19132/udp 54 | 55 | # Copy scripts to minecraftbe folder and make them executable 56 | RUN mkdir /scripts 57 | COPY *.sh /scripts/ 58 | COPY *.yml /scripts/ 59 | COPY server.properties /scripts/ 60 | RUN chmod -R +x /scripts/*.sh 61 | 62 | # Set entrypoint to start.sh script 63 | ENTRYPOINT ["/bin/bash", "/scripts/start.sh"] 64 | -------------------------------------------------------------------------------- /armv7.Dockerfile: -------------------------------------------------------------------------------- 1 | # Minecraft Java Paper Server + Geyser + Floodgate Docker Container 2 | # Author: James A. Chambers - https://jamesachambers.com/minecraft-java-bedrock-server-together-geyser-floodgate/ 3 | # GitHub Repository: https://github.com/TheRemote/Legendary-Java-Minecraft-Geyser-Floodgate 4 | 5 | # Use Ubuntu rolling version for builder 6 | FROM ubuntu:rolling AS builder 7 | 8 | # Update apt 9 | RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install qemu-user-static binfmt-support apt-utils -yqq && rm -rf /var/cache/apt/* 10 | 11 | # Use Ubuntu rolling version 12 | FROM --platform=linux/arm/v7 ubuntu:rolling 13 | 14 | # Add QEMU 15 | COPY --from=builder /usr/bin/qemu-arm-static /usr/bin/ 16 | 17 | # Fetch dependencies 18 | RUN apt update && DEBIAN_FRONTEND=noninteractive apt-get install openjdk-21-jre-headless tzdata sudo curl unzip net-tools gawk openssl findutils pigz libcurl4t64 libc6 libcrypt1 apt-utils libcurl4-openssl-dev ca-certificates binfmt-support nano -yqq && rm -rf /var/cache/apt/* 19 | 20 | # Set port environment variable 21 | ENV Port=25565 22 | 23 | # Set Bedrock port environment variable 24 | ENV BedrockPort=19132 25 | 26 | # Optional maximum memory Minecraft is allowed to use 27 | ENV MaxMemory= 28 | 29 | # Optional Paper Minecraft Version override 30 | ENV Version="1.21.4" 31 | 32 | # Optional Timezone 33 | ENV TZ="America/Denver" 34 | 35 | # Optional folder to ignore during backup operations 36 | ENV NoBackup="" 37 | 38 | # Number of rolling backups to keep 39 | ENV BackupCount=10 40 | 41 | # Optional switch to skip permissions check 42 | ENV NoPermCheck="" 43 | 44 | # Optional switch to tell curl to suppress the progress meter which generates much less noise in the logs 45 | ENV QuietCurl="" 46 | 47 | # Optional switch to disable ViaVersion 48 | ENV NoViaVersion="" 49 | 50 | # IPV4 Ports 51 | EXPOSE 25565/tcp 52 | EXPOSE 19132/tcp 53 | EXPOSE 19132/udp 54 | 55 | # Copy scripts to minecraftbe folder and make them executable 56 | RUN mkdir /scripts 57 | COPY *.sh /scripts/ 58 | COPY *.yml /scripts/ 59 | COPY server.properties /scripts/ 60 | RUN chmod -R +x /scripts/*.sh 61 | 62 | # Set entrypoint to start.sh script 63 | ENTRYPOINT ["/bin/bash", "/scripts/start.sh"] 64 | -------------------------------------------------------------------------------- /bukkit.yml: -------------------------------------------------------------------------------- 1 | settings: 2 | allow-end: true 3 | warn-on-overload: false 4 | permissions-file: permissions.yml 5 | update-folder: update 6 | plugin-profiling: false 7 | connection-throttle: 4000 8 | query-plugins: true 9 | deprecated-verbose: default 10 | shutdown-message: Server closed 11 | minimum-api: none 12 | spawn-limits: 13 | monsters: 70 14 | animals: 10 15 | water-animals: 5 16 | water-ambient: 20 17 | water-underground-creature: 5 18 | axolotls: 5 19 | ambient: 15 20 | chunk-gc: 21 | period-in-ticks: 600 22 | ticks-per: 23 | animal-spawns: 400 24 | monster-spawns: 2 25 | water-spawns: 1 26 | water-ambient-spawns: 1 27 | water-underground-creature-spawns: 1 28 | axolotl-spawns: 1 29 | ambient-spawns: 1 30 | autosave: 18000 31 | aliases: now-in-commands.yml -------------------------------------------------------------------------------- /config.yml: -------------------------------------------------------------------------------- 1 | # -------------------------------- 2 | # Geyser Configuration File 3 | # 4 | # A bridge between Minecraft: Bedrock Edition and Minecraft: Java Edition. 5 | # 6 | # GitHub: https://github.com/GeyserMC/Geyser 7 | # Discord: https://discord.geysermc.org/ 8 | # -------------------------------- 9 | 10 | bedrock: 11 | # The IP address that will listen for connections. 12 | # There is no reason to change this unless you want to limit what IPs can connect to your server. 13 | address: 0.0.0.0 14 | # The port that will listen for connections 15 | port: 19132 16 | # Some hosting services change your Java port everytime you start the server and require the same port to be used for Bedrock. 17 | # This option makes the Bedrock port the same as the Java port every time you start the server. 18 | # This option is for the plugin version only. 19 | clone-remote-port: false 20 | # The MOTD that will be broadcasted to Minecraft: Bedrock Edition clients. This is irrelevant if "passthrough-motd" is set to true 21 | # If either of these are empty, the respective string will default to "Geyser" 22 | motd1: "Geyser" 23 | motd2: "Another Geyser server." 24 | # The Server Name that will be sent to Minecraft: Bedrock Edition clients. This is visible in both the pause menu and the settings menu. 25 | server-name: "Geyser" 26 | # How much to compress network traffic to the Bedrock client. The higher the number, the more CPU usage used, but 27 | # the smaller the bandwidth used. Does not have any effect below -1 or above 9. Set to -1 to disable. 28 | compression-level: 6 29 | # Whether to enable PROXY protocol or not for clients. You DO NOT WANT this feature unless you run UDP reverse proxy 30 | # in front of your Geyser instance. 31 | enable-proxy-protocol: false 32 | # A list of allowed PROXY protocol speaking proxy IP addresses/subnets. Only effective when "enable-proxy-protocol" is enabled, and 33 | # should really only be used when you are not able to use a proper firewall (usually true with shared hosting providers etc.). 34 | # Keeping this list empty means there is no IP address whitelist. 35 | # Both IP addresses and subnets are supported. 36 | #proxy-protocol-whitelisted-ips: [ "127.0.0.1", "172.18.0.0/16" ] 37 | remote: 38 | # The IP address of the remote (Java Edition) server 39 | # If it is "auto", for standalone version the remote address will be set to 127.0.0.1, 40 | # for plugin versions, it is recommended to keep this as "auto" so Geyser will automatically configure address, port, and auth-type. 41 | # Leave as "auto" if floodgate is installed. 42 | address: auto 43 | # The port of the remote (Java Edition) server 44 | # For plugin versions, if address has been set to "auto", the port will also follow the server's listening port. 45 | port: 25565 46 | # Authentication type. Can be offline, online, or floodgate (see https://github.com/GeyserMC/Geyser/wiki/Floodgate). 47 | # For plugin versions, it's recommended to keep the `address` field to "auto" so Floodgate support is automatically configured. 48 | # If Floodgate is installed and `address:` is set to "auto", then "auth-type: floodgate" will automatically be used. 49 | auth-type: online 50 | # Allow for password-based authentication methods through Geyser. Only useful in online mode. 51 | # If this is false, users must authenticate to Microsoft using a code provided by Geyser on their desktop. 52 | allow-password-authentication: true 53 | # Whether to enable PROXY protocol or not while connecting to the server. 54 | # This is useful only when: 55 | # 1) Your server supports PROXY protocol (it probably doesn't) 56 | # 2) You run Velocity or BungeeCord with the option enabled in the proxy's main config. 57 | # IF YOU DON'T KNOW WHAT THIS IS, DON'T TOUCH IT! 58 | use-proxy-protocol: false 59 | # Forward the hostname that the Bedrock client used to connect over to the Java server 60 | # This is designed to be used for forced hosts on proxies 61 | forward-hostname: false 62 | 63 | # Floodgate uses encryption to ensure use from authorised sources. 64 | # This should point to the public key generated by Floodgate (BungeeCord, Spigot or Velocity) 65 | # You can ignore this when not using Floodgate. 66 | # If you're using a plugin version of Floodgate on the same server, the key will automatically be picked up from Floodgate. 67 | floodgate-key-file: key.pem 68 | 69 | # For online mode authentication type only. 70 | # Stores a list of Bedrock players that should have their Java Edition account saved after login. 71 | # This saves a token that can be reused to authenticate the player later. This does not save emails or passwords, 72 | # but you should still be cautious when adding to this list and giving others access to this Geyser instance's files. 73 | # Removing a name from this list will delete its cached login information on the next Geyser startup. 74 | # The file that tokens will be saved in is in the same folder as this config, named "saved-refresh-tokens.json". 75 | saved-user-logins: 76 | - ThisExampleUsernameShouldBeLongEnoughToNeverBeAnXboxUsername 77 | - ThisOtherExampleUsernameShouldAlsoBeLongEnough 78 | 79 | # Specify how many seconds to wait while user authorizes Geyser to access their Microsoft account. 80 | # User is allowed to disconnect from the server during this period. 81 | pending-authentication-timeout: 120 82 | 83 | # Bedrock clients can freeze when opening up the command prompt for the first time if given a lot of commands. 84 | # Disabling this will prevent command suggestions from being sent and solve freezing for Bedrock clients. 85 | command-suggestions: true 86 | 87 | # The following three options enable "ping passthrough" - the MOTD, player count and/or protocol name gets retrieved from the Java server. 88 | # Relay the MOTD from the remote server to Bedrock players. 89 | passthrough-motd: false 90 | # Relay the protocol name (e.g. BungeeCord [X.X], Paper 1.X) - only really useful when using a custom protocol name! 91 | # This will also show up on sites like MCSrvStatus. 92 | passthrough-protocol-name: false 93 | # Relay the player count and max players from the remote server to Bedrock players. 94 | passthrough-player-counts: false 95 | # Enable LEGACY ping passthrough. There is no need to enable this unless your MOTD or player count does not appear properly. 96 | # This option does nothing on standalone. 97 | legacy-ping-passthrough: false 98 | # How often to ping the remote server, in seconds. Only relevant for standalone or legacy ping passthrough. 99 | # Increase if you are getting BrokenPipe errors. 100 | ping-passthrough-interval: 3 101 | 102 | # Whether to forward player ping to the server. While enabling this will allow Bedrock players to have more accurate 103 | # ping, it may also cause players to time out more easily. 104 | forward-player-ping: false 105 | 106 | # Maximum amount of players that can connect. This is only visual at this time and does not actually limit player count. 107 | max-players: 100 108 | 109 | # If debug messages should be sent through console 110 | debug-mode: false 111 | 112 | # Allow third party capes to be visible. Currently allowing: 113 | # OptiFine capes, LabyMod capes, 5Zig capes and MinecraftCapes 114 | allow-third-party-capes: true 115 | 116 | # Allow third party deadmau5 ears to be visible. Currently allowing: 117 | # MinecraftCapes 118 | allow-third-party-ears: false 119 | 120 | # Allow a fake cooldown indicator to be sent. Bedrock players do not see a cooldown as they still use 1.8 combat 121 | # Can be title, actionbar or false 122 | show-cooldown: title 123 | 124 | # Controls if coordinates are shown to players. 125 | show-coordinates: true 126 | 127 | # Whether Bedrock players are blocked from performing their scaffolding-style bridging. 128 | disable-bedrock-scaffolding: false 129 | 130 | # Whether Bedrock players can right-click outside of their inventory to replace armor in their inventory, even if the 131 | # armor slot is already occupied (which Java Edition doesn't allow) 132 | always-quick-change-armor: false 133 | 134 | # If set, when a Bedrock player performs any emote, it will swap the offhand and mainhand items, just like the Java Edition keybind 135 | # There are three options this can be set to: 136 | # disabled - the default/fallback, which doesn't apply this workaround 137 | # no-emotes - emotes will NOT be sent to other Bedrock clients and offhand will be swapped. This effectively disables all emotes from being seen. 138 | # emotes-and-offhand - emotes will be sent to Bedrock clients and offhand will be swapped 139 | emote-offhand-workaround: "disabled" 140 | 141 | # The default locale if we dont have the one the client requested. Uncomment to not use the default system language. 142 | # default-locale: en_us 143 | 144 | # Specify how many days images will be cached to disk to save downloading them from the internet. 145 | # A value of 0 is disabled. (Default: 0) 146 | cache-images: 0 147 | 148 | # Allows custom skulls to be displayed. Keeping them enabled may cause a performance decrease on older/weaker devices. 149 | allow-custom-skulls: true 150 | 151 | # The maximum number of custom skulls to be displayed per player. Increasing this may decrease performance on weaker devices. 152 | # Setting this to -1 will cause all custom skulls to be displayed regardless of distance or number. 153 | max-visible-custom-skulls: 128 154 | 155 | # The radius in blocks around the player in which custom skulls are displayed. 156 | custom-skull-render-distance: 32 157 | 158 | # Whether to add (at this time, only) the furnace minecart as a separate item in the game, which normally does not exist in Bedrock Edition. 159 | # This should only need to be disabled if using a proxy that does not use the "transfer packet" style of server switching. 160 | # If this is disabled, furnace minecart items will be mapped to hopper minecart items. 161 | # This option requires a restart of Geyser in order to change its setting. 162 | add-non-bedrock-items: true 163 | 164 | # Bedrock prevents building and displaying blocks above Y127 in the Nether. 165 | # This config option works around that by changing the Nether dimension ID to the End ID. 166 | # The main downside to this is that the entire Nether will have the same red fog rather than having different fog for each biome. 167 | above-bedrock-nether-building: false 168 | 169 | # Force clients to load all resource packs if there are any. 170 | # If set to false, it allows the user to connect to the server even if they don't 171 | # want to download the resource packs. 172 | force-resource-packs: true 173 | 174 | # Allows Xbox achievements to be unlocked. 175 | # THIS DISABLES ALL COMMANDS FROM SUCCESSFULLY RUNNING FOR BEDROCK IN-GAME, as otherwise Bedrock thinks you are cheating. 176 | xbox-achievements-enabled: false 177 | 178 | # Whether player IP addresses will be logged by the server. 179 | log-player-ip-addresses: true 180 | 181 | # Whether to alert the console and operators that a new Geyser version is available that supports a Bedrock version 182 | # that this Geyser version does not support. It's recommended to keep this option enabled, as many Bedrock platforms 183 | # auto-update. 184 | notify-on-new-bedrock-update: true 185 | 186 | # bStats is a stat tracker that is entirely anonymous and tracks only basic information 187 | # about Geyser, such as how many people are online, how many servers are using Geyser, 188 | # what OS is being used, etc. You can learn more about bStats here: https://bstats.org/. 189 | # https://bstats.org/plugin/server-implementation/GeyserMC 190 | metrics: 191 | # If metrics should be enabled 192 | enabled: true 193 | # UUID of server, don't change! 194 | uuid: 96e45ad9-512d-4907-8a92-1ec5ebed6d5f 195 | 196 | # ADVANCED OPTIONS - DO NOT TOUCH UNLESS YOU KNOW WHAT YOU ARE DOING! 197 | 198 | # Geyser updates the Scoreboard after every Scoreboard packet, but when Geyser tries to handle 199 | # a lot of scoreboard packets per second can cause serious lag. 200 | # This option allows you to specify after how many Scoreboard packets per seconds 201 | # the Scoreboard updates will be limited to four updates per second. 202 | scoreboard-packet-threshold: 20 203 | 204 | # Allow connections from ProxyPass and Waterdog. 205 | # See https://www.spigotmc.org/wiki/firewall-guide/ for assistance - use UDP instead of TCP. 206 | enable-proxy-connections: false 207 | 208 | # The internet supports a maximum MTU of 1492 but could cause issues with packet fragmentation. 209 | # 1400 is the default. 210 | mtu: 1400 211 | 212 | # Whether to connect directly into the Java server without creating a TCP connection. 213 | # This should only be disabled if a plugin that interfaces with packets or the network does not work correctly with Geyser. 214 | # If enabled on plugin versions, the remote address and port sections are ignored 215 | # If disabled on plugin versions, expect performance decrease and latency increase 216 | use-direct-connection: true 217 | 218 | config-version: 4 219 | -------------------------------------------------------------------------------- /docker-compose.yml: -------------------------------------------------------------------------------- 1 | # Minecraft Java Paper Server + Geyser + Floodgate Docker Container - Docker Compose 2 | # Author: James A. Chambers - https://jamesachambers.com/minecraft-java-bedrock-server-together-geyser-floodgate/ 3 | # GitHub Repository: https://github.com/TheRemote/Legendary-Java-Minecraft-Geyser-Floodgate 4 | 5 | # To run multiple servers change the volume name under both "volumes" sections and select different ports 6 | version: "3.5" 7 | services: 8 | minecraftbe: 9 | image: 05jchambers/legendary-minecraft-geyser-floodgate:latest 10 | restart: "unless-stopped" 11 | ports: 12 | - 25565:25565 13 | - 19132:19132 14 | - 19132:19132/udp 15 | volumes: 16 | - minecraft:/minecraft 17 | stdin_open: true # docker run -i 18 | tty: true # docker run -t 19 | entrypoint: [ "/bin/bash", "/scripts/start.sh" ] 20 | # Environment variables 21 | environment: 22 | Port: "25565" 23 | BedrockPort: "19132" 24 | TZ: "America/Denver" # Timezone 25 | #BackupCount: 10 # Number of rolling backups to keep 26 | #MaxMemory: 2048 # Maximum memory usage for Java 27 | #Version: 1.19.3 # Use custom version 28 | #NoBackup: "plugins" # Optional folder to skip during backups 29 | #NoPermCheck: "Y" # Optional flag to skip permissions check 30 | #NoViaVersion: "Y" # Optional flag to disable ViaVersion plugin 31 | #QuietCurl: "Y" # Optional flag to reduce curl log output by suppressing progress meter 32 | volumes: 33 | minecraft: 34 | driver: local -------------------------------------------------------------------------------- /hooks/post_push: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Use manifest-tool to create the manifest 4 | curl -Lo manifest-tool.tar.gz https://github.com/estesp/manifest-tool/releases/download/v2.1.8/binaries-manifest-tool-2.1.8.tar.gz 5 | tar -xf manifest-tool.tar.gz 6 | chmod +x manifest-tool* 7 | 8 | ManifestTool=$(./manifest-tool-linux-amd64 push from-spec multi-arch-manifest.yaml 2>&1) 9 | echo "$ManifestTool" 10 | -------------------------------------------------------------------------------- /hooks/pre_build: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Register qemu-*-static for all supported processors except the current one, but also remove all registered binfmt_misc before 4 | docker run --rm --privileged multiarch/qemu-user-static:register --reset -------------------------------------------------------------------------------- /kubernetes/01-namespace.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Namespace 3 | metadata: 4 | name: minecraft 5 | labels: 6 | name: minecraft -------------------------------------------------------------------------------- /kubernetes/02-pvc.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: PersistentVolumeClaim 3 | metadata: 4 | name: minecraft-pvc 5 | namespace: minecraft 6 | spec: 7 | accessModes: 8 | - ReadWriteOnce 9 | storageClassName: longhorn-retain 10 | resources: 11 | requests: 12 | storage: 3Gi 13 | -------------------------------------------------------------------------------- /kubernetes/03-deployment.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: apps/v1 2 | kind: Deployment 3 | metadata: 4 | namespace: minecraft 5 | name: minecraft 6 | spec: 7 | replicas: 1 8 | selector: 9 | matchLabels: 10 | app: minecraft 11 | template: 12 | metadata: 13 | labels: 14 | app: minecraft 15 | spec: 16 | containers: 17 | - name: minecraft 18 | image: 05jchambers/legendary-minecraft-geyser-floodgate:latest 19 | imagePullPolicy: IfNotPresent 20 | volumeMounts: 21 | - name: minecraft-data 22 | mountPath: /minecraft 23 | env: 24 | - name: MaxMemory 25 | value: '1024' 26 | - name: k8s 27 | value: "True" 28 | resources: 29 | limits: 30 | cpu: 1500m 31 | memory: 1024M 32 | ephemeral-storage: 50Mi 33 | requests: 34 | cpu: 750m 35 | memory: 750M 36 | ephemeral-storage: 2Mi 37 | ports: 38 | - containerPort: 25565 39 | name: java 40 | - containerPort: 19132 41 | name: bedrock-v4 42 | - containerPort: 19133 43 | name: bedrock-v6 44 | volumes: 45 | - name: minecraft-data 46 | persistentVolumeClaim: 47 | claimName: minecraft-pvc -------------------------------------------------------------------------------- /kubernetes/04-service.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Service 3 | metadata: 4 | name: minecraft 5 | namespace: minecraft 6 | spec: 7 | type: LoadBalancer 8 | ipFamilyPolicy: PreferDualStack 9 | ipFamilies: 10 | - IPv4 11 | - IPv6 12 | ports: 13 | - name: java 14 | port: 25565 15 | protocol: TCP 16 | targetPort: java 17 | - name: bedrock-v4-udp 18 | port: 19132 19 | protocol: UDP 20 | targetPort: bedrock-v4 21 | - name: bedrock-v6-udp 22 | port: 19133 23 | protocol: UDP 24 | targetPort: bedrock-v6 25 | - name: bedrock-v4-tcp 26 | port: 19132 27 | protocol: TCP 28 | targetPort: bedrock-v4 29 | - name: bedrock-v6-tcp 30 | port: 19133 31 | protocol: TCP 32 | targetPort: bedrock-v6 33 | selector: 34 | app: minecraft -------------------------------------------------------------------------------- /multi-arch-manifest.yaml: -------------------------------------------------------------------------------- 1 | image: 05jchambers/legendary-minecraft-geyser-floodgate:latest 2 | manifests: 3 | - image: 05jchambers/legendary-minecraft-geyser-floodgate:amd64 4 | platform: 5 | architecture: amd64 6 | os: linux 7 | - image: 05jchambers/legendary-minecraft-geyser-floodgate:armv7 8 | platform: 9 | architecture: arm 10 | os: linux 11 | variant: v7 12 | - image: 05jchambers/legendary-minecraft-geyser-floodgate:arm64v8 13 | platform: 14 | architecture: arm64 15 | os: linux 16 | variant: v8 17 | - image: 05jchambers/legendary-minecraft-geyser-floodgate:ppc64le 18 | platform: 19 | architecture: ppc64le 20 | os: linux 21 | - image: 05jchambers/legendary-minecraft-geyser-floodgate:s390x 22 | platform: 23 | architecture: s390x 24 | os: linux -------------------------------------------------------------------------------- /paper-global.yml: -------------------------------------------------------------------------------- 1 | # This is the global configuration file for Paper. 2 | # As you can see, there's a lot to configure. Some options may impact gameplay, so use 3 | # with caution, and make sure you know what each option does before configuring. 4 | # 5 | # If you need help with the configuration or have any questions related to Paper, 6 | # join us in our Discord or check the docs page. 7 | # 8 | # The world configuration options have been moved inside 9 | # their respective world folder. The files are named paper-world.yml 10 | # 11 | # Docs: https://docs.papermc.io/ 12 | # Discord: https://discord.gg/papermc 13 | # Website: https://papermc.io/ 14 | 15 | _version: 28 16 | async-chunks: 17 | threads: -1 18 | chunk-loading: 19 | autoconfig-send-distance: true 20 | enable-frustum-priority: false 21 | global-max-chunk-load-rate: -1.0 22 | global-max-chunk-send-rate: -1.0 23 | global-max-concurrent-loads: 500.0 24 | max-concurrent-sends: 2 25 | min-load-radius: 2 26 | player-max-chunk-load-rate: -1.0 27 | player-max-concurrent-loads: 20.0 28 | target-player-chunk-send-rate: 100.0 29 | chunk-system: 30 | gen-parallelism: default 31 | io-threads: -1 32 | worker-threads: -1 33 | collisions: 34 | enable-player-collisions: true 35 | send-full-pos-for-hard-colliding-entities: true 36 | commands: 37 | fix-target-selector-tag-completion: true 38 | suggest-player-names-when-null-tab-completions: true 39 | time-command-affects-all-worlds: false 40 | console: 41 | enable-brigadier-completions: true 42 | enable-brigadier-highlighting: true 43 | has-all-permissions: false 44 | item-validation: 45 | book: 46 | author: 8192 47 | page: 16384 48 | title: 8192 49 | book-size: 50 | page-max: 2560 51 | total-multiplier: 0.98 52 | display-name: 8192 53 | lore-line: 8192 54 | resolve-selectors-in-books: false 55 | logging: 56 | deobfuscate-stacktraces: true 57 | log-player-ip-addresses: true 58 | use-rgb-for-named-text-colors: true 59 | messages: 60 | kick: 61 | authentication-servers-down: 62 | connection-throttle: Connection throttled! Please wait before reconnecting. 63 | flying-player: 64 | flying-vehicle: 65 | no-permission: I'm sorry, but you do not have permission to perform this command. Please 66 | contact the server administrators if you believe that this is in error. 67 | use-display-name-in-quit-message: false 68 | misc: 69 | chat-threads: 70 | chat-executor-core-size: -1 71 | chat-executor-max-size: -1 72 | fix-entity-position-desync: true 73 | lag-compensate-block-breaking: true 74 | load-permissions-yml-before-plugins: true 75 | max-joins-per-tick: 3 76 | region-file-cache-size: 256 77 | strict-advancement-dimension-check: false 78 | use-alternative-luck-formula: false 79 | use-dimension-type-for-custom-spawners: false 80 | packet-limiter: 81 | all-packets: 82 | action: KICK 83 | interval: 7.0 84 | max-packet-rate: 500.0 85 | kick-message: 86 | overrides: 87 | ServerboundPlaceRecipePacket: 88 | action: DROP 89 | interval: 4.0 90 | max-packet-rate: 5.0 91 | player-auto-save: 92 | max-per-tick: -1 93 | rate: -1 94 | proxies: 95 | bungee-cord: 96 | online-mode: false 97 | proxy-protocol: false 98 | velocity: 99 | enabled: false 100 | online-mode: false 101 | secret: '' 102 | scoreboards: 103 | save-empty-scoreboard-teams: false 104 | track-plugin-scoreboards: false 105 | spam-limiter: 106 | incoming-packet-threshold: 300 107 | recipe-spam-increment: 1 108 | recipe-spam-limit: 20 109 | tab-spam-increment: 1 110 | tab-spam-limit: 500 111 | timings: 112 | enabled: true 113 | hidden-config-entries: 114 | - database 115 | - settings.bungeecord-addresses 116 | - settings.velocity-support.secret 117 | - proxies.velocity.secret 118 | history-interval: 300 119 | history-length: 3600 120 | server-name: Unknown Server 121 | server-name-privacy: false 122 | url: https://timings.aikar.co/ 123 | verbose: true 124 | unsupported-settings: 125 | allow-grindstone-overstacking: false 126 | allow-headless-pistons: false 127 | allow-permanent-block-break-exploits: false 128 | allow-piston-duplication: false 129 | perform-username-validation: true 130 | watchdog: 131 | early-warning-delay: 120000 132 | early-warning-every: 60000 133 | -------------------------------------------------------------------------------- /ppc64le.Dockerfile: -------------------------------------------------------------------------------- 1 | # Minecraft Java Paper Server + Geyser + Floodgate Docker Container 2 | # Author: James A. Chambers - https://jamesachambers.com/minecraft-java-bedrock-server-together-geyser-floodgate/ 3 | # GitHub Repository: https://github.com/TheRemote/Legendary-Java-Minecraft-Geyser-Floodgate 4 | 5 | # Use latest Ubuntu version for builder 6 | FROM ubuntu:rolling AS builder 7 | 8 | # Update apt 9 | RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install qemu-user-static binfmt-support apt-utils -yqq && rm -rf /var/cache/apt/* 10 | 11 | # Use Ubuntu rolling version 12 | FROM --platform=linux/ppc64le ubuntu:rolling 13 | 14 | # Add QEMU 15 | COPY --from=builder /usr/bin/qemu-ppc64le-static /usr/bin/ 16 | 17 | # Fetch dependencies 18 | RUN apt update && DEBIAN_FRONTEND=noninteractive apt-get install openjdk-21-jre-headless tzdata sudo curl unzip net-tools gawk openssl findutils pigz libcurl4 libc6 libcrypt1 apt-utils libcurl4-openssl-dev ca-certificates binfmt-support nano -yqq && rm -rf /var/cache/apt/* 19 | 20 | # Set port environment variable 21 | ENV Port=25565 22 | 23 | # Set Bedrock port environment variable 24 | ENV BedrockPort=19132 25 | 26 | # Optional maximum memory Minecraft is allowed to use 27 | ENV MaxMemory= 28 | 29 | # Optional Paper Minecraft Version override 30 | ENV Version="1.21.4" 31 | 32 | # Optional Timezone 33 | ENV TZ="America/Denver" 34 | 35 | # Optional folder to ignore during backup operations 36 | ENV NoBackup="" 37 | 38 | # Number of rolling backups to keep 39 | ENV BackupCount=10 40 | 41 | # Optional switch to skip permissions check 42 | ENV NoPermCheck="" 43 | 44 | # Optional switch to tell curl to suppress the progress meter which generates much less noise in the logs 45 | ENV QuietCurl="" 46 | 47 | # Optional switch to disable ViaVersion 48 | ENV NoViaVersion="" 49 | 50 | # IPV4 Ports 51 | EXPOSE 25565/tcp 52 | EXPOSE 19132/tcp 53 | EXPOSE 19132/udp 54 | 55 | # Copy scripts to minecraftbe folder and make them executable 56 | RUN mkdir /scripts 57 | COPY *.sh /scripts/ 58 | COPY *.yml /scripts/ 59 | COPY server.properties /scripts/ 60 | RUN chmod -R +x /scripts/*.sh 61 | 62 | # Set entrypoint to start.sh script 63 | ENTRYPOINT ["/bin/bash", "/scripts/start.sh"] 64 | -------------------------------------------------------------------------------- /riscv64.Dockerfile: -------------------------------------------------------------------------------- 1 | # Minecraft Java Paper Server + Geyser + Floodgate Docker Container 2 | # Author: James A. Chambers - https://jamesachambers.com/minecraft-java-bedrock-server-together-geyser-floodgate/ 3 | # GitHub Repository: https://github.com/TheRemote/Legendary-Java-Minecraft-Geyser-Floodgate 4 | 5 | # Use latest Ubuntu version for builder 6 | FROM ubuntu:rolling AS builder 7 | 8 | # Update apt 9 | RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install qemu-user-static binfmt-support apt-utils -yqq && rm -rf /var/cache/apt/* 10 | 11 | # Use current Ubuntu LTS version 12 | FROM --platform=linux/riscv64 ubuntu:rolling 13 | 14 | # Add QEMU 15 | COPY --from=builder /usr/bin/qemu-riscv64-static /usr/bin/ 16 | 17 | # Fetch dependencies 18 | RUN apt update && DEBIAN_FRONTEND=noninteractive apt-get install openjdk-21-jre-headless tzdata sudo curl unzip net-tools gawk openssl findutils pigz libcurl4 libc6 libcrypt1 apt-utils libcurl4-openssl-dev ca-certificates binfmt-support nano -yqq && rm -rf /var/cache/apt/* 19 | 20 | # Set port environment variable 21 | ENV Port=25565 22 | 23 | # Set Bedrock port environment variable 24 | ENV BedrockPort=19132 25 | 26 | # Optional maximum memory Minecraft is allowed to use 27 | ENV MaxMemory= 28 | 29 | # Optional Paper Minecraft Version override 30 | ENV Version="1.21.4" 31 | 32 | # Optional Timezone 33 | ENV TZ="America/Denver" 34 | 35 | # Optional folder to ignore during backup operations 36 | ENV NoBackup="" 37 | 38 | # Number of rolling backups to keep 39 | ENV BackupCount=10 40 | 41 | # Optional switch to skip permissions check 42 | ENV NoPermCheck="" 43 | 44 | # Optional switch to tell curl to suppress the progress meter which generates much less noise in the logs 45 | ENV QuietCurl="" 46 | 47 | # Optional switch to disable ViaVersion 48 | ENV NoViaVersion="" 49 | 50 | # IPV4 Ports 51 | EXPOSE 25565/tcp 52 | EXPOSE 19132/tcp 53 | EXPOSE 19132/udp 54 | 55 | # Copy scripts to minecraftbe folder and make them executable 56 | RUN mkdir /scripts 57 | COPY *.sh /scripts/ 58 | COPY *.yml /scripts/ 59 | COPY server.properties /scripts/ 60 | RUN chmod -R +x /scripts/*.sh 61 | 62 | # Set entrypoint to start.sh script 63 | ENTRYPOINT ["/bin/bash", "/scripts/start.sh"] 64 | -------------------------------------------------------------------------------- /s390x.Dockerfile: -------------------------------------------------------------------------------- 1 | # Minecraft Java Paper Server + Geyser + Floodgate Docker Container 2 | # Author: James A. Chambers - https://jamesachambers.com/minecraft-java-bedrock-server-together-geyser-floodgate/ 3 | # GitHub Repository: https://github.com/TheRemote/Legendary-Java-Minecraft-Geyser-Floodgate 4 | 5 | # Use Ubuntu rolling version for builder 6 | FROM ubuntu:rolling AS builder 7 | 8 | # Update apt 9 | RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install qemu-user-static binfmt-support apt-utils -yqq && rm -rf /var/cache/apt/* 10 | 11 | # Use Ubuntu rolling version 12 | FROM --platform=linux/s390x ubuntu:rolling 13 | 14 | # Add QEMU 15 | COPY --from=builder /usr/bin/qemu-s390x-static /usr/bin/ 16 | 17 | # Fetch dependencies 18 | RUN apt update && DEBIAN_FRONTEND=noninteractive apt-get install openjdk-21-jre-headless tzdata sudo curl unzip net-tools gawk openssl findutils pigz libcurl4 libc6 libcrypt1 apt-utils libcurl4-openssl-dev ca-certificates binfmt-support nano -yqq && rm -rf /var/cache/apt/* 19 | 20 | # Set port environment variable 21 | ENV Port=25565 22 | 23 | # Set Bedrock port environment variable 24 | ENV BedrockPort=19132 25 | 26 | # Optional maximum memory Minecraft is allowed to use 27 | ENV MaxMemory= 28 | 29 | # Optional Paper Minecraft Version override 30 | ENV Version="1.21.4" 31 | 32 | # Optional Timezone 33 | ENV TZ="America/Denver" 34 | 35 | # Optional folder to ignore during backup operations 36 | ENV NoBackup="" 37 | 38 | # Number of rolling backups to keep 39 | ENV BackupCount=10 40 | 41 | # Optional switch to skip permissions check 42 | ENV NoPermCheck="" 43 | 44 | # Optional switch to tell curl to suppress the progress meter which generates much less noise in the logs 45 | ENV QuietCurl="" 46 | 47 | # Optional switch to disable ViaVersion 48 | ENV NoViaVersion="" 49 | 50 | # IPV4 Ports 51 | EXPOSE 25565/tcp 52 | EXPOSE 19132/tcp 53 | EXPOSE 19132/udp 54 | 55 | # Copy scripts to minecraftbe folder and make them executable 56 | RUN mkdir /scripts 57 | COPY *.sh /scripts/ 58 | COPY *.yml /scripts/ 59 | COPY server.properties /scripts/ 60 | RUN chmod -R +x /scripts/*.sh 61 | 62 | # Set entrypoint to start.sh script 63 | ENTRYPOINT ["/bin/bash", "/scripts/start.sh"] 64 | -------------------------------------------------------------------------------- /server.properties: -------------------------------------------------------------------------------- 1 | # Minecraft server properties 2 | enable-jmx-monitoring=false 3 | rcon.port=25575 4 | level-seed= 5 | gamemode=survival 6 | enable-command-block=false 7 | enable-query=false 8 | generator-settings={} 9 | level-name=world 10 | motd=A Minecraft Server 11 | query.port=25565 12 | pvp=true 13 | generate-structures=true 14 | difficulty=easy 15 | network-compression-threshold=512 16 | require-resource-pack=false 17 | max-tick-time=120000 18 | use-native-transport=true 19 | max-players=20 20 | online-mode=true 21 | enable-status=true 22 | allow-flight=false 23 | broadcast-rcon-to-ops=true 24 | view-distance=10 25 | server-ip= 26 | resource-pack-prompt= 27 | allow-nether=true 28 | server-port=25565 29 | enable-rcon=false 30 | sync-chunk-writes=true 31 | op-permission-level=4 32 | prevent-proxy-connections=false 33 | hide-online-players=false 34 | resource-pack= 35 | entity-broadcast-range-percentage=100 36 | simulation-distance=10 37 | rcon.password= 38 | player-idle-timeout=0 39 | debug=false 40 | force-gamemode=false 41 | rate-limit=0 42 | hardcore=false 43 | white-list=false 44 | broadcast-console-to-ops=true 45 | spawn-npcs=true 46 | spawn-animals=true 47 | function-permission-level=2 48 | level-type=default 49 | text-filtering-config= 50 | spawn-monsters=true 51 | enforce-whitelist=false 52 | resource-pack-sha1= 53 | spawn-protection=0 54 | max-world-size=29999984 55 | enforce-secure-profile=false -------------------------------------------------------------------------------- /spigot.yml: -------------------------------------------------------------------------------- 1 | # This is the main configuration file for Spigot. 2 | # As you can see, there's tons to configure. Some options may impact gameplay, so use 3 | # with caution, and make sure you know what each option does before configuring. 4 | # For a reference for any variable inside this file, check out the Spigot wiki at 5 | # http://www.spigotmc.org/wiki/spigot-configuration/ 6 | # 7 | # If you need help with the configuration or have any questions related to Spigot, 8 | # join us at the Discord or drop by our forums and leave a post. 9 | # 10 | # Discord: https://www.spigotmc.org/go/discord 11 | # Forums: http://www.spigotmc.org/ 12 | 13 | settings: 14 | debug: false 15 | sample-count: 12 16 | bungeecord: false 17 | player-shuffle: 0 18 | user-cache-size: 1000 19 | save-user-cache-on-stop-only: false 20 | moved-wrongly-threshold: 0.0625 21 | moved-too-quickly-multiplier: 10.0 22 | timeout-time: 60 23 | restart-on-crash: true 24 | restart-script: ./start.sh 25 | netty-threads: 4 26 | attribute: 27 | maxHealth: 28 | max: 2048.0 29 | movementSpeed: 30 | max: 2048.0 31 | attackDamage: 32 | max: 2048.0 33 | log-villager-deaths: true 34 | log-named-deaths: true 35 | messages: 36 | whitelist: You are not whitelisted on this server! 37 | unknown-command: Unknown command. Type "/help" for help. 38 | server-full: The server is full! 39 | outdated-client: Outdated client! Please use {0} 40 | outdated-server: Outdated server! I'm still on {0} 41 | restart: Server is restarting 42 | advancements: 43 | disable-saving: false 44 | disabled: 45 | - minecraft:story/disabled 46 | players: 47 | disable-saving: false 48 | commands: 49 | spam-exclusions: 50 | - /skill 51 | silent-commandblock-console: false 52 | replace-commands: 53 | - setblock 54 | - summon 55 | - testforblock 56 | - tellraw 57 | log: true 58 | tab-complete: 0 59 | send-namespaced: true 60 | world-settings: 61 | default: 62 | below-zero-generation-in-existing-chunks: true 63 | verbose: false 64 | merge-radius: 65 | exp: 6.0 66 | item: 4.0 67 | growth: 68 | cactus-modifier: 100 69 | cane-modifier: 100 70 | melon-modifier: 100 71 | mushroom-modifier: 100 72 | pumpkin-modifier: 100 73 | sapling-modifier: 100 74 | beetroot-modifier: 100 75 | carrot-modifier: 100 76 | potato-modifier: 100 77 | wheat-modifier: 100 78 | netherwart-modifier: 100 79 | vine-modifier: 100 80 | cocoa-modifier: 100 81 | bamboo-modifier: 100 82 | sweetberry-modifier: 100 83 | kelp-modifier: 100 84 | twistingvines-modifier: 100 85 | weepingvines-modifier: 100 86 | cavevines-modifier: 100 87 | glowberry-modifier: 100 88 | entity-activation-range: 89 | animals: 32 90 | monsters: 32 91 | raiders: 48 92 | misc: 16 93 | water: 16 94 | villagers: 32 95 | flying-monsters: 32 96 | wake-up-inactive: 97 | animals-max-per-tick: 4 98 | animals-every: 1200 99 | animals-for: 100 100 | monsters-max-per-tick: 8 101 | monsters-every: 400 102 | monsters-for: 100 103 | villagers-max-per-tick: 4 104 | villagers-every: 600 105 | villagers-for: 100 106 | flying-monsters-max-per-tick: 8 107 | flying-monsters-every: 200 108 | flying-monsters-for: 100 109 | villagers-work-immunity-after: 100 110 | villagers-work-immunity-for: 20 111 | villagers-active-for-panic: true 112 | tick-inactive-villagers: true 113 | ignore-spectators: false 114 | entity-tracking-range: 115 | players: 48 116 | animals: 48 117 | monsters: 48 118 | misc: 32 119 | other: 64 120 | ticks-per: 121 | hopper-transfer: 8 122 | hopper-check: 1 123 | hopper-amount: 1 124 | dragon-death-sound-radius: 0 125 | seed-village: 10387312 126 | seed-desert: 14357617 127 | seed-igloo: 14357618 128 | seed-jungle: 14357619 129 | seed-swamp: 14357620 130 | seed-monument: 10387313 131 | seed-shipwreck: 165745295 132 | seed-ocean: 14357621 133 | seed-outpost: 165745296 134 | seed-endcity: 10387313 135 | seed-slime: 987234911 136 | seed-nether: 30084232 137 | seed-mansion: 10387319 138 | seed-fossil: 14357921 139 | seed-portal: 34222645 140 | seed-stronghold: default 141 | hunger: 142 | jump-walk-exhaustion: 0.05 143 | jump-sprint-exhaustion: 0.2 144 | combat-exhaustion: 0.1 145 | regen-exhaustion: 6.0 146 | swim-multiplier: 0.01 147 | sprint-multiplier: 0.1 148 | other-multiplier: 0.0 149 | max-tnt-per-tick: 100 150 | max-tick-time: 151 | tile: 50 152 | entity: 50 153 | view-distance: default 154 | simulation-distance: default 155 | thunder-chance: 100000 156 | item-despawn-rate: 6000 157 | enable-zombie-pigmen-portal-spawns: true 158 | wither-spawn-sound-radius: 0 159 | arrow-despawn-rate: 1200 160 | trident-despawn-rate: 1200 161 | hanging-tick-frequency: 100 162 | zombie-aggressive-towards-villager: true 163 | nerf-spawner-mobs: false 164 | mob-spawn-range: 6 165 | end-portal-sound-radius: 0 166 | config-version: 12 167 | stats: 168 | disable-saving: false 169 | forced-stats: {} 170 | -------------------------------------------------------------------------------- /start.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Legendary Paper Minecraft Java Server Docker + Geyser/Floodgate server startup script 3 | # Author: James A. Chambers - https://jamesachambers.com/minecraft-java-bedrock-server-together-geyser-floodgate/ 4 | # GitHub Repository: https://github.com/TheRemote/Legendary-Java-Minecraft-Geyser-Floodgate 5 | 6 | # If running as root, create 'minecraft' user and restart script as 'minecraft' user 7 | if [ "$(id -u)" = '0' ]; then 8 | echo "Script is running as root, switching to 'minecraft' user..." 9 | 10 | if ! id minecraft >/dev/null 2>&1; then 11 | echo "Creating 'minecraft' user..." 12 | useradd -m -r -s /bin/bash minecraft 13 | fi 14 | 15 | chown -R minecraft:minecraft /minecraft 16 | 17 | exec su minecraft -c "$0 $@" 18 | fi 19 | 20 | echo "Paper Minecraft Java Server Docker + Geyser/Floodgate script by James A. Chambers" 21 | echo "Latest version always at https://github.com/TheRemote/Legendary-Java-Minecraft-Geyser-Floodgate" 22 | echo "Don't forget to set up port forwarding on your router! The default port is 25565 and the Bedrock port is 19132" 23 | 24 | if [ ! -d '/minecraft' ]; then 25 | echo "ERROR: A named volume was not specified for the minecraft server data. Please create one with: docker volume create yourvolumename" 26 | echo "Please pass the new volume to docker like this: docker run -it -v yourvolumename:/minecraft" 27 | exit 1 28 | fi 29 | 30 | # Randomizer for user agent 31 | RandNum=$(echo $((1 + $RANDOM % 5000))) 32 | 33 | if [ -z "$Port" ]; then 34 | Port="25565" 35 | fi 36 | echo "Port used: $Port" 37 | 38 | if [ -z "$BedrockPort" ]; then 39 | Port="19132" 40 | fi 41 | echo "Bedrock port used: $BedrockPort" 42 | 43 | # Change directory to server directory 44 | cd /minecraft 45 | 46 | # Create backups/downloads folder if it doesn't exist 47 | if [ ! -d "/minecraft/downloads" ]; then 48 | mkdir -p /minecraft/downloads 49 | fi 50 | if [ ! -d "/minecraft/config" ]; then 51 | mkdir -p /minecraft/config 52 | fi 53 | if [ ! -d "/minecraft/backups" ]; then 54 | mkdir -p /minecraft/backups 55 | fi 56 | if [ ! -d "/minecraft/plugins/Geyser-Spigot" ]; then 57 | mkdir -p /minecraft/plugins/Geyser-Spigot 58 | fi 59 | 60 | # Check if network interfaces are up 61 | NetworkChecks=0 62 | if [ -e '/sbin/route' ]; then 63 | DefaultRoute=$(/sbin/route -n | awk '$4 == "UG" {print $2}') 64 | else 65 | DefaultRoute=$(route -n | awk '$4 == "UG" {print $2}') 66 | fi 67 | while [ -z "$DefaultRoute" ]; do 68 | echo "Network interface not up, will try again in 1 second" 69 | sleep 1 70 | if [ -e '/sbin/route' ]; then 71 | DefaultRoute=$(/sbin/route -n | awk '$4 == "UG" {print $2}') 72 | else 73 | DefaultRoute=$(route -n | awk '$4 == "UG" {print $2}') 74 | fi 75 | NetworkChecks=$((NetworkChecks + 1)) 76 | if [ $NetworkChecks -gt 20 ]; then 77 | echo "Waiting for network interface to come up timed out - starting server without network connection ..." 78 | break 79 | fi 80 | done 81 | 82 | # Take ownership of server files and set correct permissions 83 | if [ -z "$NoPermCheck" ]; then 84 | echo "Taking ownership of all server files/folders in /minecraft..." 85 | sudo -n chown -R $(whoami) /minecraft >/dev/null 2>&1 86 | echo "Complete" 87 | else 88 | echo "Skipping permissions check due to NoPermCheck flag" 89 | fi 90 | 91 | # Back up server 92 | if [ -d "world" ]; then 93 | if [ -n "$(which pigz)" ]; then 94 | echo "Backing up server (all cores) to cd minecraft/backups folder" 95 | tarArgs=(-I pigz --exclude='./backups' --exclude='./cache' --exclude='./logs' --exclude='./paperclip.jar') 96 | IFS=',' 97 | read -ra ADDR <<< "$NoBackup" 98 | for i in "${ADDR[@]}"; do 99 | tarArgs+=(--exclude="./$i") 100 | done 101 | tarArgs+=(-pvcf backups/$(date +%Y.%m.%d.%H.%M.%S).tar.gz ./*) 102 | tar "${tarArgs[@]}" 103 | else 104 | echo "Backing up server (single core, pigz not found) to cd minecraft/backups folder" 105 | tarArgs=(--exclude='./backups' --exclude='./cache' --exclude='./logs' --exclude='./paperclip.jar') 106 | IFS=',' 107 | read -ra ADDR <<< "$NoBackup" 108 | for i in "${ADDR[@]}"; do 109 | tarArgs+=(--exclude="./$i") 110 | done 111 | tarArgs+=(-pvcf backups/$(date +%Y.%m.%d.%H.%M.%S).tar.gz ./*) 112 | tar "${tarArgs[@]}" 113 | fi 114 | fi 115 | 116 | # Rotate backups 117 | if [ -d /minecraft/backups ]; then 118 | Rotate=$( 119 | pushd /minecraft/backups 120 | ls -1tr | head -n -$BackupCount | xargs -d '\n' rm -f -- 121 | popd 122 | ) 123 | fi 124 | 125 | # Copy config files if this is a brand new server 126 | if [ ! -e "/minecraft/bukkit.yml" ]; then 127 | cp /scripts/bukkit.yml /minecraft/bukkit.yml 128 | fi 129 | if [ ! -e "/minecraft/config/paper-global.yml" ]; then 130 | cp /scripts/paper-global.yml /minecraft/config/paper-global.yml 131 | fi 132 | if [ ! -e "/minecraft/spigot.yml" ]; then 133 | cp /scripts/spigot.yml /minecraft/spigot.yml 134 | fi 135 | if [ ! -e "/minecraft/server.properties" ]; then 136 | cp /scripts/server.properties /minecraft/server.properties 137 | fi 138 | if [ ! -e "/minecraft/plugins/Geyser-Spigot/config.yml" ]; then 139 | cp /scripts/config.yml /minecraft/plugins/Geyser-Spigot/config.yml 140 | fi 141 | 142 | # Test internet connectivity first 143 | # Update paperclip.jar 144 | echo "Updating to most recent paperclip version ..." 145 | 146 | # Test internet connectivity first 147 | if [ -z "$QuietCurl" ]; then 148 | curl -H "Accept-Encoding: identity" -H "Accept-Language: en" -L -A "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4.212 Safari/537.36" -s https://papermc.io -o /dev/null 149 | else 150 | curl --no-progress-meter -H "Accept-Encoding: identity" -H "Accept-Language: en" -L -A "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4.212 Safari/537.36" -s https://papermc.io -o /dev/null 151 | fi 152 | 153 | if [ "$?" != 0 ]; then 154 | echo "Unable to connect to update website (internet connection may be down). Skipping update ..." 155 | else 156 | # Get latest build 157 | BuildJSON=$(curl --no-progress-meter -H "Accept-Encoding: identity" -H "Accept-Language: en" -L -A "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4.212 Safari/537.36" https://api.papermc.io/v2/projects/paper/versions/$Version) 158 | Build=$(echo "$BuildJSON" | rev | cut -d, -f 1 | cut -d']' -f 2 | cut -d'[' -f 1 | rev) 159 | Build=$(($Build + 0)) 160 | if [[ $Build != 0 ]]; then 161 | echo "Latest paperclip build found: $Build" 162 | if [ -z "$QuietCurl" ]; then 163 | curl -H "Accept-Encoding: identity" -H "Accept-Language: en" -L -A "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4.212 Safari/537.36" -o /minecraft/paperclip.jar "https://api.papermc.io/v2/projects/paper/versions/$Version/builds/$Build/downloads/paper-$Version-$Build.jar" 164 | else 165 | curl --no-progress-meter -H "Accept-Encoding: identity" -H "Accept-Language: en" -L -A "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4.212 Safari/537.36" -o /minecraft/paperclip.jar "https://api.papermc.io/v2/projects/paper/versions/$Version/builds/$Build/downloads/paper-$Version-$Build.jar" 166 | fi 167 | else 168 | echo "Unable to retrieve latest Paper build (got result of $Build)" 169 | fi 170 | 171 | # Update Floodgate 172 | echo "Updating Floodgate..." 173 | if [ -z "$QuietCurl" ]; then 174 | curl -H "Accept-Encoding: identity" -H "Accept-Language: en" -L -A "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4.212 Safari/537.36" -o /minecraft/plugins/Floodgate-Spigot.jar "https://download.geysermc.org/v2/projects/floodgate/versions/latest/builds/latest/downloads/spigot" 175 | else 176 | curl --no-progress-meter -H "Accept-Encoding: identity" -H "Accept-Language: en" -L -A "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4.212 Safari/537.36" -o /minecraft/plugins/Floodgate-Spigot.jar "https://download.geysermc.org/v2/projects/floodgate/versions/latest/builds/latest/downloads/spigot" 177 | fi 178 | 179 | # Update Geyser 180 | echo "Updating Geyser..." 181 | if [ -z "$QuietCurl" ]; then 182 | curl -H "Accept-Encoding: identity" -H "Accept-Language: en" -L -A "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4.212 Safari/537.36" -o /minecraft/plugins/Geyser-Spigot.jar "https://download.geysermc.org/v2/projects/geyser/versions/latest/builds/latest/downloads/spigot" 183 | else 184 | curl --no-progress-meter -H "Accept-Encoding: identity" -H "Accept-Language: en" -L -A "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4.212 Safari/537.36" -o /minecraft/plugins/Geyser-Spigot.jar "https://download.geysermc.org/v2/projects/geyser/versions/latest/builds/latest/downloads/spigot" 185 | fi 186 | 187 | if [ -z "$NoViaVersion" ]; then 188 | # Update ViaVersion if new version is available 189 | ViaVersionVersion=$(curl --no-progress-meter -k -L -H "Accept-Encoding: identity" -H "Accept-Language: en" -L -A "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4.212 Safari/537.36" https://ci.viaversion.com/job/ViaVersion/lastBuild/artifact/build/libs/ | grep -P '(?<=href=")ViaVersion[^"]+' -o --max-count=1 | head -n1) 190 | if [ -n "$ViaVersionVersion" ]; then 191 | ViaVersionMD5=$(curl --no-progress-meter -k -L -H "Accept-Encoding: identity" -H "Accept-Language: en" -L -A "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4.212 Safari/537.36" "https://ci.viaversion.com/job/ViaVersion/lastBuild/artifact/build/libs/$ViaVersionVersion/*fingerprint*/" | grep breadcrumbs | cut -d'_' -f24- | cut -d'<' -f2 | cut -d'>' -f2) 192 | if [ -n "$ViaVersionMD5" ]; then 193 | LocalMD5=$(md5sum plugins/ViaVersion.jar | cut -d' ' -f1) 194 | if [ -e /minecraft/plugins/ViaVersion.jar ] && [ "$LocalMD5" = "$ViaVersionMD5" ]; then 195 | echo "ViaVersion is up to date" 196 | else 197 | echo "Updating ViaVersion..." 198 | if [ -z "$QuietCurl" ]; then 199 | curl -H "Accept-Encoding: identity" -H "Accept-Language: en" -L -A "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4.212 Safari/537.36" -o /minecraft/plugins/ViaVersion.jar "https://ci.viaversion.com/job/ViaVersion/lastBuild/artifact/build/libs/$ViaVersionVersion" 200 | else 201 | curl --no-progress-meter -H "Accept-Encoding: identity" -H "Accept-Language: en" -L -A "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4.212 Safari/537.36" -o /minecraft/plugins/ViaVersion.jar "https://ci.viaversion.com/job/ViaVersion/lastBuild/artifact/build/libs/$ViaVersionVersion" 202 | fi 203 | fi 204 | else 205 | echo "Unable to check for updates to ViaVersion!" 206 | fi 207 | fi 208 | else 209 | echo "ViaVersion is disabled -- skipping" 210 | fi 211 | fi 212 | 213 | # Accept EULA 214 | AcceptEULA=$(echo eula=true >eula.txt) 215 | 216 | # Change ports in server.properties 217 | sed -i "/server-port=/c\server-port=$Port" /minecraft/server.properties 218 | sed -i "/query\.port=/c\query\.port=$Port" /minecraft/server.properties 219 | # Change Bedrock port in Geyser config 220 | if [ -e /minecraft/plugins/Geyser-Spigot/config.yml ]; then 221 | sed -i -z "s/ port: [0-9]*/ port: $BedrockPort/" /minecraft/plugins/Geyser-Spigot/config.yml 222 | fi 223 | 224 | # Start server 225 | echo "Starting Minecraft server..." 226 | 227 | if [[ -z "$MaxMemory" ]] || [[ "$MaxMemory" -le 0 ]]; then 228 | exec java -XX:+UnlockDiagnosticVMOptions -XX:-UseAESCTRIntrinsics -DPaper.IgnoreJavaVersion=true -Xms400M -jar /minecraft/paperclip.jar 229 | else 230 | exec java -XX:+UnlockDiagnosticVMOptions -XX:-UseAESCTRIntrinsics -DPaper.IgnoreJavaVersion=true -Xms400M -Xmx${MaxMemory}M -jar /minecraft/paperclip.jar 231 | fi 232 | 233 | # Exit container 234 | exit 0 235 | --------------------------------------------------------------------------------