Overview
The integration system provides:- Embedded Chromium browser (MCEF/JCEF)
- REST API and WebSocket server for UI communication
- ViaFabricPlus protocol switching support
- Theme and component management
- External system browser fallback
Browser Backend System
BrowserBackendManager
Manages browser initialization and lifecycle (BrowserBackendManager.kt:39).
Environment Variables
Skip browser initialization entirely
Browser backend to use (
cef, external, none)Disable hardware acceleration
CEF Browser Backend
Chromium Embedded Framework integration via MCEF (CefBrowserBackend.kt:64).
Features
Full Chromium
Complete Chromium browser engine in Minecraft
Hardware Acceleration
GPU-accelerated rendering support
Auto Downloads
Automatic JCEF library downloading
Cache Management
Intelligent cache cleanup and management
MCEF Configuration
Directory Structure
MCEF root directory
Cache Cleanup
Automatic cleanup of old cache directories (CefBrowserBackend.kt:129):
Cache directories older than 7 days are automatically cleaned up on startup.
Compatibility Checking
Client Interop Server
HTTP/WebSocket server for browser-client communication (ClientInteropServer.kt:44).
Server Configuration
Skip interop server initialization
Server port (defaults to random available port)
Authentication code (16 random alphanumeric characters)
Server Initialization
API Endpoints
The server exposes extensive REST API endpoints organized by category:Client Functions
Client Functions
/api/v1/client/info- Client information/api/v1/client/modules- Module management/api/v1/client/accounts- Account management/api/v1/client/session- Session data/api/v1/client/theme- Theme operations/api/v1/client/components- HUD components
Game Functions
Game Functions
/api/v1/game/player- Player data/api/v1/game/world- World information/api/v1/game/servers- Server list/api/v1/game/textures- Texture access/api/v1/game/input- Input handling/api/v1/game/registry- Game registries
Feature Functions
Feature Functions
/api/v1/features/browser- Browser control/api/v1/features/protocol- Protocol switching/api/v1/features/reconnect- Auto-reconnect
WebSocket Events
Real-time event streaming to the browser:Authentication System
Secure authentication using randomly generated codes (AuthMiddleware.kt):
ViaFabricPlus Integration
Support for protocol version switching when ViaFabricPlus is installed.Protocol Detection
Automatic Protocol Switching
When loading auto-configs with different protocol versions:Theme System
Manage custom themes and UI components.Theme Structure
Theme storage directory
HUD Components
The integration system supports various HUD component types:Web Components
Browser-rendered HUD elements
Native Components
Kotlin-rendered components
Minimap
Real-time world minimap
Browser Lifecycle Management
Creating Browsers
Browser States
Browser is loading the page
Page loaded successfully (includes HTTP status code)
Failed to load page (includes error code and message)
Force Update
Refresh all browser viewports:External System Browser Backend
Fallback browser backend using the system’s default browser (ExternalSystemBrowserBackend.kt).
The external backend opens URLs in the system browser when CEF is unavailable or disabled.
Screen Management
Custom screen types for browser integration:- Standalone
- Overlay
- Internet Explorer
Full-screen browser window
Performance Considerations
Render Thread
Browser operations must run on the render thread
Message Loop
CEF message loop runs on every frame render
Hardware Acceleration
Can be disabled for compatibility
Priority System
Browsers render in priority order
Troubleshooting
JCEF download fails
JCEF download fails
Check internet connection and firewall settings. The system will automatically retry with a random port.
Browser not rendering
Browser not rendering
Ensure you’re on the render thread and the backend is initialized.
Port already in use
Port already in use
The server automatically retries with different ports (up to 5 attempts).
Authentication errors
Authentication errors
Verify the auth code is correctly passed from the interop server to the browser.
Best Practices
Related Documentation
MCEF Project
LiquidBounce’s MCEF fork
Theme System
Creating custom themes