-
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
446 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
FROM ubuntu:noble | ||
ARG BASHIO_VERSION="0.14.3" | ||
ARG BEDROCK_SERVER_VERSION="1.21.51.01" | ||
ARG BUILD_VERSION="${BEDROCK_SERVER_VERSION}" | ||
ARG BUILD_ARCH="amd64" | ||
ENV LD_LIBRARY_PATH /opt/minecraft | ||
COPY rootfs / | ||
WORKDIR /opt/minecraft/ | ||
RUN apt-get update \ | ||
&& apt-get install -y --no-install-recommends jq curl ca-certificates unzip \ | ||
&& rm -rf /var/lib/apt/lists/* \ | ||
&& rm -rf /usr/src/* | ||
RUN mkdir -p /usr/src/bashio \ | ||
&& curl -s -L "https://github.com/hassio-addons/bashio/archive/v${BASHIO_VERSION}.tar.gz" \ | ||
| tar -xzf - --strip 1 -C /usr/src/bashio \ | ||
&& mv /usr/src/bashio/lib /usr/lib/bashio \ | ||
&& ln -s /usr/lib/bashio/bashio /usr/bin/bashio | ||
RUN curl -L \ | ||
-H "User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36 Edg/131.0.2903.86" \ | ||
-O "https://www.minecraft.net/bedrockdedicatedserver/bin-linux/bedrock-server-${BEDROCK_SERVER_VERSION}.zip" \ | ||
&& unzip -q bedrock-server-${BEDROCK_SERVER_VERSION}.zip \ | ||
&& rm -f bedrock-server-${BEDROCK_SERVER_VERSION}.zip | ||
CMD ["/opt/minecraft/run.sh"] | ||
VOLUME /data /share | ||
WORKDIR /data | ||
LABEL \ | ||
io.hass.version="${BUILD_VERSION}" \ | ||
io.hass.type="addon" \ | ||
io.hass.arch="${BUILD_ARCH}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
# Home Assistant Add-on: Minecraft | ||
|
||
Minecraft servers allow players to play online or via a local area network with other people. Internally, the game runs a server for single-player games, this was done in order to make the single-player game experience consistent with the multiplayer experience and make it so that changes made to the game such as bug fixes apply to both single-player games and multiplayer games. | ||
|
||
![Supports amd64 Architecture][amd64-shield] | ||
|
||
## About | ||
|
||
This add-on allows you to run Minecraft: Bedrock Edition server within Home Assistant. | ||
|
||
## Installation | ||
|
||
Follow these steps to get the add-on installed on your system: | ||
|
||
1. Navigate in your Home Assistant frontend to Supervisor -> Add-on Store. | ||
2. Find the "Minecraft: Bedrock Edition Server" add-on and click it. | ||
3. Click on the "INSTALL" button. | ||
|
||
## How to use | ||
|
||
Update the configuration to your specification and then start the add-on. | ||
|
||
## Configuration | ||
|
||
Via the application's settings page. | ||
|
||
## Support | ||
|
||
While there is no warranty or support, you are welcome to raise an [Issue](https://github.com/evilmarty/hassio-addons/issues). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
name: "Minecraft: Bedrock Edition Server" | ||
version: "1.21.51.01-a" | ||
slug: "minecraft_bedrock" | ||
description: "Run a private server for Minecraft: Bedrock Edition." | ||
url: "https://github.com/evilmarty/hassio-addons/tree/master/minecraft_bedrock" | ||
image: "ghcr.io/evilmarty/hassio-minecraft-bedrock" | ||
arch: | ||
- amd64 | ||
startup: "application" | ||
init: true | ||
boot: "auto" | ||
watchdog: "tcp://[HOST]:[PORT:19132]" | ||
ports: | ||
"19132/tcp": 19132 | ||
"19133/tcp": 19133 | ||
ports_description: | ||
"19132/tcp": "Used for gameplay and LAN discovery" | ||
"19133/tcp": "Used for gameplay" | ||
map: | ||
- config:rw | ||
environment: | ||
PUID: "0" | ||
PGID: "0" | ||
options: | ||
server-name: My World | ||
gamemode: survival | ||
force-gamemode: false | ||
difficulty: easy | ||
allow-cheats: false | ||
max-players: 10 | ||
level-name: Bedrock level | ||
online-mode: true | ||
allow-list: false | ||
view-distance: 32 | ||
player-idle-timeout: 30 | ||
max-threads: 8 | ||
tick-distance: 4 | ||
default-player-permission-level: member | ||
texturepack-required: false | ||
compression-threshold: 1 | ||
compression-algorithm: zlib | ||
server-authoritative-movement: server-auth | ||
player-position-acceptance-threshold: 0.5 | ||
player-movement-action-direction-threshold: 0.85 | ||
server-authoritative-block-breaking: false | ||
server-authoritative-block-breaking-pick-range-scalar: 1.5 | ||
chat-restriction: None | ||
disable-player-interaction: false | ||
client-side-chunk-generation-enabled: true | ||
block-network-ids-are-hashes: true | ||
disable-custom-skins: false | ||
schema: | ||
server-name: str | ||
gamemode: list(survival|creative|adventure|spectator) | ||
force-gamemode: bool | ||
difficulty: list(peaceful|easy|normal|hard) | ||
allow-cheats: bool | ||
max-players: int(0,) | ||
level-name: str | ||
level-seed: str? | ||
online-mode: bool | ||
allow-list: bool | ||
view-distance: int(3,32) | ||
player-idle-timeout: int | ||
max-threads: int(0,) | ||
tick-distance: int(4,12) | ||
default-player-permission-level: list(visitor|member|operator) | ||
texturepack-required: bool | ||
compression-threshold: int(0,) | ||
compression-algorithm: list(zlib|snappy) | ||
server-authoritative-movement: list(client-auth|server-auth|server-auth-with-rewind) | ||
player-position-acceptance-threshold: float(0.0,) | ||
player-movement-action-direction-threshold: float | ||
server-authoritative-block-breaking: bool | ||
server-authoritative-block-breaking-pick-range-scalar: float(1.0,) | ||
chat-restriction: list(None|Dropped|Disabled) | ||
disable-player-interaction: bool | ||
client-side-chunk-generation-enabled: bool | ||
block-network-ids-are-hashes: bool | ||
disable-custom-skins: bool |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
#!/usr/bin/env bashio | ||
|
||
SERVER_PROPERTIES_PATH="server.properties" | ||
SCRIPT_DIR=$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" &>/dev/null && pwd) | ||
BIN_PATH="${SCRIPT_DIR}/bedrock_server" | ||
SERVER_FOLDERS=("behavior_packs" "definitions" "resource_packs") | ||
|
||
main() { | ||
bashio::log.debug "Working directory is ${PWD}" | ||
|
||
write_server_properties "${SERVER_PROPERTIES_PATH}" | ||
add_ports_to_server_properties "${SERVER_PROPERTIES_PATH}" | ||
copy_folders_to_working_dir "$SCRIPT_DIR" "${SERVER_FOLDERS[@]}" | ||
|
||
bashio::log.debug "Starting bedrock server..." | ||
exec "$BIN_PATH" | ||
} | ||
|
||
write_server_properties() { | ||
local path config | ||
path="$1" | ||
config=$(bashio::addon.config) | ||
bashio::jq "${config}" 'to_entries|map("\(.key)=\(.value)")|join("\n")' >"${path}" | ||
bashio::log.debug "Updated ${path} with config" | ||
} | ||
|
||
add_ports_to_server_properties() { | ||
local path port portv6 | ||
path="$1" | ||
port=$(bashio::addon.port 19132) | ||
portv6=$(bashio::addon.port 19133) | ||
|
||
touch "$path" | ||
echo "server-port=${port}" >>"$path" | ||
echo "server-portv6=${portv6}" >>"$path" | ||
bashio::log.debug "Added server ports to ${path}" | ||
} | ||
|
||
copy_folders_to_working_dir() { | ||
local src item | ||
src="$1" | ||
for item in "${@:1}"; do | ||
bashio::log.debug "Checking if working directory has ${item}..." | ||
if [ ! -d "$item" ]; then | ||
bashio::log.debug "Copying ${item} to working directory" | ||
cp -r "${src}/${item}" . | ||
fi | ||
done | ||
} | ||
|
||
main "$@" |
Oops, something went wrong.