Skip to content

Lyzev/ZenithProxy

 
 

Repository files navigation

Fork

This is a fork of ZenithProxy, a Minecraft proxy and bot designed for 2b2t.org but also works on any server. This fork is intended to be used for 2b2t.org

Note: I will not provide any support for this fork, as it is a personal project. If you have any questions or issues, please refer to the original repository.

Why this fork?

I needed an optimized version of ZenithProxy since I am running it on a very cheap and low-end VPS. I removed all the unnecessary code and dependencies, and I also added Docker files to make it easier to run the proxy in a container.

I was able to reduce the memory usage of the proxy to about 65mb (~50% reduction).

Changes

  • I removed all ViaVersion code, as it is not needed for 2b2t.org
  • I removed all Update/Version checking code, as it is not needed in my opinion.
  • I added Docker files to make it easier to run the proxy in a container. (See the docker-graalvm directory)
  • I removed features that I don't need, such as the Map, Spectator mode, ReplayMod, etc.

Running the proxy

Download the GraalVM build from the Build Linux action, and put ZenithProxy binary file in the docker-graalvm/build/native/nativeCompile directory.

Then, run the following command to build the Docker image:

docker build -t zenithproxy .
docker image save zenithproxy -o zenithproxy.tar

Then, copy the zenithproxy.tar file to the server where you want to run the proxy, and run the following command:

docker load -i zenithproxy.tar

Now you can use the docker image to run the proxy! Note it is recommended to use a preconfigured config.json file, as the docker image's terminal is not working properly. With a preconfigured config.json file, you can use Discord commands to manage the proxy.

ZenithProxy

Discord

Minecraft Lines of Code

Minecraft proxy and bot designed for 2b2t.org but also works on any server.

ZenithProxy is a MC bot with an integrated MC server that players can log into and control.

Have your accounts always online in-game and securely shared with your friends.

This project is also used for the 2b2t.vc API and Discord Bot.

What is a proxy?
This proxy itself consists of two components:
1. A Minecraft Server ("Proxy Server")
2. A Minecraft Client ("Proxy Client")

Players use a Minecraft client to connect to the Proxy Server as you would a normal MC server.
The Proxy Client connects to a destination MC server (i.e. 2b2t.org).
The Player's packets to the Proxy Server get forwarded to the Proxy Client which 
forwards them to the destination MC server.

Player MC Client -> Proxy Server -> Proxy Client -> MC Server

When no Player Client is connected the Proxy Client will act 
as a bot: moving around, chatting, etc.
How does it work?
ZenithProxy does not use, depend on, or interact with the Minecraft client or server code.
This means much greater opportunities for optimizing memory usage and performance.

But this also means existing MC mods or plugins cannot be used and must be
reimplemented specifically for ZenithProxy.

ZenithProxy acts primarily at the network packet layer. It can read/modify/cancel/send
arbitrary packets in either direction at any time.

Using packet interception, the client's session and world state is cached and 
sent to players when they connect.

The cached world state is also used to simulate player movements, 
inventory actions, discord chat relay, and all features.

Features

  • High performance and efficiency on minimal hardware, <300MB RAM per java instance or <150MB on linux.
  • Integrated ViaVersion
    • Can connect to (almost) any MC server and players can connect with (almost) any MC client
  • Secure Whitelist system - share MC accounts without sharing passwords
  • Extensive Discord Bot integration for management and monitoring
    • Chat relay
    • Customizable pings, alerts, and notifications. e.g. Player in visual range alerts
  • Command System - Discord, In-game, and Terminal
    • 25+ commands and modules to configure every feature
  • Spectator mode
    • Multiple players can connect to the proxy and spectate the player
  • Advanced AntiAFK with full player movement simulation
  • Integrated ReplayMod Recording
  • Modules including AutoEat, AutoDisconnect, AutoReconnect, AutoRespawn, AutoTotem, KillAura, Spammer, AutoReply
  • Many, many, more features.

Getting Started

Setup and Download

System Requirements

  1. Linux, Windows, or Mac computer. I recommend using a VPS (droplet) from DigitalOcean:
  2. Java 21+ (Not required for linux release channel on supported CPU)
    • The ZenithProxy launcher will install Java 21 automatically if not already installed

Launcher

  1. Download the launcher zip for your system
  2. Unzip the file.
  3. Run the launcher executable in a terminal:
    • Linux/Mac: ./launch
    • Python: ./launch.sh (Linux/Mac) or .\launch.bat (Windows)
How do I download a file from a Linux terminal?
  • Use wget in the terminal
  • Example: wget https://github.com/rfresh2/ZenithProxy/releases/download/launcher-v3/ZenithProxy-launcher-linux-amd64.zip
Recommended unzip tools
Recommended Terminals

Run

  • The launcher will ask for all configuration on first launch
    • Or run the launcher with the --setup flag. e.g. .\launch.exe --setup
  • Use the connect command to link an MC account and log in once ZenithProxy is launched
  • Command Prefixes:
    • Discord: . (e.g. .help)
    • In-game: / OR ! -> (e.g. /help)
    • Terminal: N/A -> (e.g. help)
  • Full Commands Documentation

Running on Linux Servers

See the Linux Guide

I highly recommend using a terminal multiplexer - a program that manages terminal sessions.

If you do not use one, ZenithProxy will be killed after you exit your SSH session.

Configuration

Release Channels

  • (Default) java - Supports all operating systems
  • (Recommended) linux - Linux native x86_64 executable. ~50% reduced memory usage and instant startup

DNS Setup

  • To use a domain name you need the following DNS records:
    • an A record to the public IP address of your server Example
    • an SRV record for _minecraft._tcp with the port and the A record as its target. Example

Discord Bot Setup

Running Multiple Instances

Create a new folder for each instance with its own copy of the launcher files. Example

Instances must be independently run and configured. i.e. separate terminal sessions, discord bots, ports, config files, etc.

See the Linux Guide for help copying files, creating folders, etc.

2b2t Limits

2b2t limits accounts without priority queue based on:

  1. Accounts currently connected per IP address
  2. In-game session time, excluding time in queue.

Current limits are documented in a discord channel

Development

I highly recommend using Intellij for building and running local development instances.

Gradle will automatically install the required Java version for compiling (currently Java 23)

Most useful gradle tasks:

  • run - Builds and runs a local dev instance
  • jarBuild - Builds an executable jar to build/libs/ZenithProxy.jar
  • build - Compiles and runs tests without building a jar

Special Thanks

About

2b2t minecraft proxy / bot

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Languages

  • Java 96.2%
  • Python 3.4%
  • Other 0.4%