Minecraft Editions
Gate supports both Java Edition (PC) and Bedrock Edition (Mobile, Console, Windows) Minecraft clients. This page explains how each edition is implemented and how they work together.Edition Architecture
Java Edition
Overview
Java Edition is the original Minecraft written in Java, primarily played on PC. Gate’s Java proxy is the core component and is always active. Package:pkg/edition/java/proxyMain struct:
Proxy (proxy.go:42-70)
Features
Full protocol support:- Minecraft 1.7.2 through latest version
- Multi-version support (no client mods required)
- Automatic protocol translation
- Forge/Fabric mod support
- Online mode (Mojang authentication)
- Offline mode (no authentication)
- Custom authentication servers
- Velocity/BungeeCord forwarding modes
- Plugin messages (custom protocols)
- Boss bars and titles
- Tab list manipulation
- Resource pack management
- Server switching
- Chat handling
- Command system
Protocol Handling
The Java protocol is complex and version-specific. Gate handles this through: State machine:pkg/edition/java/proto/version for version mappings.
Packet registry:
Each protocol version has different packet IDs. Gate maintains registries that map:
- Packet ID → Packet struct (decoding)
- Packet struct → Packet ID (encoding)
Session Handlers
Java connections use dedicated session handlers for each phase:| Handler | File | Purpose |
|---|---|---|
handshakeSessionHandler | session_client_handshake.go | Initial handshake |
statusSessionHandler | session_status.go | Server list ping |
initialLoginSessionHandler | session_client_initial_login.go | Authentication |
configSessionHandler | session_client_config.go | 1.20.2+ config phase |
clientPlaySessionHandler | session_client_play.go | Active gameplay |
backendPlaySessionHandler | session_backend_play.go | Backend connection |
Forge/Fabric Support
Gate supports modded clients: Forge:- Legacy Forge (1.7-1.12)
- Modern Forge (1.13+)
- Forge handshake protocol
- Mod list exchange
- No special handling required
- Works like vanilla
pkg/edition/java/forge for Forge-specific code.
Bedrock Edition
Overview
Bedrock Edition is the C++ rewrite of Minecraft, used on:- Mobile (iOS, Android)
- Consoles (Xbox, PlayStation, Nintendo Switch)
- Windows 10/11 (Microsoft Store version)
pkg/edition/bedrock/proxyMain struct:
Proxy (proxy.go:55-63)
Geyser Integration
Geyser is a third-party bridge that translates between Bedrock and Java protocols. Gate integrates Geyser in two modes:1. External Geyser
Run Geyser as a separate process:2. Managed Geyser (Embedded)
Gate can download and manage Geyser automatically:- Gate downloads Geyser JAR on first start
- Generates Geyser config with overrides
- Starts Geyser as a subprocess
- Geyser connects back to Gate’s Java proxy
- Gate manages Geyser lifecycle (start/stop/reload)
pkg/edition/bedrock/geyser/integration.go for implementation.
Floodgate Authentication
Floodgate allows Bedrock players to join without a Java account: How it works:- Bedrock player authenticates with Xbox Live
- Geyser validates Xbox authentication
- Geyser generates a profile for the player
- Geyser uses Floodgate’s encryption key to sign the profile
- Gate receives the player via Java protocol
- Gate validates Floodgate signature
- Player is allowed in without Mojang authentication
Protocol Differences
Java and Bedrock protocols are fundamentally different:| Aspect | Java | Bedrock |
|---|---|---|
| Transport | TCP | UDP (RakNet) |
| Packets | Variable-length | Fixed structures |
| Encryption | AES/CFB8 | AES/GCM |
| Compression | zlib | None (RakNet handles it) |
| Block IDs | Namespaced IDs | Numeric runtime IDs |
| Items | NBT tags | Complex item structures |
| Auth | Mojang | Xbox Live |
Limitations
Some features don’t translate perfectly: Java → Bedrock:- Some custom items may not display correctly
- Chat formatting differences
- Some particles/effects missing
- Redstone timing differences
- Some Bedrock-exclusive items unsupported
- Emotes don’t translate
- Some touch controls require adaptation
Bedrock Proxy Implementation
The Bedrock proxy (pkg/edition/bedrock/proxy/proxy.go) is minimal:
- Bedrock proxy requires Java proxy (mandatory dependency)
- It’s primarily a wrapper around Geyser integration
- Most logic is delegated to Geyser
- Gate sees all Bedrock players as Java players internally
- Java proxy starts first
- Bedrock proxy initializes Geyser
- Geyser starts and connects to Java proxy
- Bedrock players can now connect
proxy.go:67-126 for startup implementation.
Cross-Play Configuration
To enable cross-play between Java and Bedrock:Basic Setup
- Java players connect to
your-server.com:25565 - Bedrock players connect to
your-server.com:19132 - Both see each other in-game
Advanced Configuration
Edition Detection
Gate automatically detects which edition a player is using: Java players:- Direct connection to Gate
Player.Protocol()returns Java protocol version- No special prefix in username
- Connection via Geyser
- Appear as Java players with special properties
- Username has configured prefix
- Can detect via Floodgate data
Backend Server Requirements
Backend servers must support both editions: For Java players:- Any vanilla/Paper/Spigot/etc. server works
- No special configuration needed
- Server must not have authentication
- Use Floodgate plugin/mod if you need player data
- Set
online-mode=falsein server.properties - Configure player forwarding (Velocity/BungeeCord)
- Set
online-mode=falseon backend servers - Enable Velocity forwarding on Gate
- Install Velocity support on Paper servers
- Optionally install Floodgate on backends for Bedrock player detection
Performance Considerations
Java Edition:- Minimal overhead (~2-5ms latency)
- Direct packet forwarding
- Protocol translation is fast
- Additional overhead from Geyser (~5-15ms)
- UDP → TCP conversion
- Complex protocol translation
- More CPU usage (Geyser runs in separate JVM)
- Use dedicated server for large Bedrock player counts
- Consider external Geyser for better resource isolation
- Monitor Geyser memory usage (separate from Gate)
Next Steps
- Bedrock Setup Guide: Configure Bedrock support
- Configuration Reference: All configuration options
- Architecture: Learn about Gate’s internals

