-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstart.sh
More file actions
28 lines (23 loc) · 700 Bytes
/
start.sh
File metadata and controls
28 lines (23 loc) · 700 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#!/bin/bash
VIAPROXY_JAR="ViaProxy.jar"
VIAPROXY_URL="https://github.com/ViaVersion/ViaProxy/releases/latest/download/ViaProxy.jar"
# Download ViaProxy if not already present
if [ ! -f "$VIAPROXY_JAR" ]; then
echo "Downloading ViaProxy..."
curl -L -o "$VIAPROXY_JAR" "$VIAPROXY_URL"
fi
# Start ViaProxy headlessly
# Listens on :25566, forwards to your 26.1.x server
echo "Starting ViaProxy..."
java -jar $VIAPROXY_JAR \
--bind_address 127.0.0.1 \
--bind_port 25566 \
--target_address "$MC_HOST" \
--target_port "${MC_PORT:-25565}" \
--version "26.1.2" \
--auth_method none &
# Wait for ViaProxy to be ready
sleep 5
# Start the bot
echo "Starting Mineflayer bot..."
node index.js