Development Environment
IDE Setup
IntelliJ IDEA (Recommended)
IntelliJ IDEA offers the best Kotlin debugging experience:-
Open as Gradle Project
- File → Open → Select LiquidBounce directory
- Let Gradle sync complete
-
Generate Sources (Optional but Recommended)
This decompiles Minecraft code for easier debugging.
-
Enable Auto-Import
- Settings → Build, Execution, Deployment → Build Tools → Gradle
- Enable “Auto-import”
Running with Debugger
Method 1: Gradle Task
- Open Gradle panel (View → Tool Windows → Gradle)
- Navigate to:
LiquidBounce → fabric → runClient - Right-click → Debug ‘LiquidBounce [runClient]‘
Method 2: Run Configuration
- Edit Configurations → + → Gradle
- Configure:
- Name: Debug LiquidBounce Client
- Gradle project: LiquidBounce
- Tasks:
runClient - VM options:
-Xmx4G(optional, for more memory)
- Click Debug button
Debugging Techniques
Breakpoints
Set breakpoints in your code to pause execution:- Click in the left margin next to the line number
- Or press
Ctrl+F8(Windows/Linux) or⌘+F8(Mac)
Conditional Breakpoints
Break only when certain conditions are met:- Right-click a breakpoint
- Enter condition (e.g.,
player.health < 5.0)
Logging Breakpoints
Log messages without stopping execution:- Right-click a breakpoint
- Check “Evaluate and log”
- Enter expression to log
- Uncheck “Suspend”
Evaluate Expression
While paused at a breakpoint:- Alt+F8 (Windows/Linux) or ⌥+F8 (Mac)
- Type any Kotlin/Java expression
- See immediate results
Console Logging
Using LiquidBounce Logger
Minecraft Logger
Chat Messages (In-Game Debugging)
Common Debugging Scenarios
Debugging Modules
Module Not Working
-
Check if enabled
-
Verify event handlers
-
Check conditions
Module Settings Not Saving
- Check config serialization
- Verify value changes:
Debugging Events
Event Not Firing
-
Verify event handler registration
-
Check event sequence
- Ensure module is enabled - Handlers typically only fire when module is enabled
Event Firing Too Often
Use throttling or debouncing:Debugging Rendering
Rendering Not Showing
-
Check render event
-
Verify coordinates
- Check GL state - Ensure proper GL setup
Debugging Mixins
Mixin Not Applying
-
Check mixin configuration in
fabric.mod.json -
Verify target class
-
Check injection point
- Review Mixin logs - Check console for mixin application errors
Performance Debugging
Profiling
JVM Profiler
Use IntelliJ’s built-in profiler:- Run → Profile ‘LiquidBounce [runClient]’
- Analyze CPU and memory usage
- Identify bottlenecks
Manual Timing
Memory Leaks
Check for Retained References
- Take heap dump after running for a while
- Analyze with Memory Profiler
- Look for growing collections or unclosed resources
Common Issues
- Event handlers not unregistered
- Static collections growing unbounded
- Cached data not cleared
Remote Debugging
Attach Debugger to Running Instance
-
Add JVM arguments
-
Create Remote Debug Configuration in IntelliJ
- Run → Edit Configurations → + → Remote JVM Debug
- Host: localhost
- Port: 5005
- Attach debugger when client is running
Build Debugging
Gradle Build Issues
Enable Debug Logging
build.log for detailed information.
Clean and Rebuild
Check Dependency Resolution
Theme Build Issues
Manual Theme Build
Check Node.js Version
Testing and Validation
Run Tests with Debugging
Code Quality Checks
Run Detekt
Verify i18n
Common Issues and Solutions
Client Won’t Start
-
Check JDK version
- Verify Gradle sync completed in IDE
-
Regenerate sources
ClassNotFoundException
-
Rebuild project
- Invalidate caches (IntelliJ: File → Invalidate Caches)
-
Check dependencies in
build.gradle.kts
Crashes
-
Check crash log in
crash-reports/directory - Look for stack trace in console
- Identify last executed code before crash
- Reproduce with minimal code to isolate issue
Debugging Tools
In-Game Commands
Use LiquidBounce commands for live debugging:External Tools
- VisualVM: JVM monitoring and profiling
- JProfiler: Advanced profiling
- YourKit: Performance analysis
- MAT (Memory Analyzer Tool): Heap dump analysis
Best Practices
- Use meaningful log messages - Include context
- Remove debug logs before committing
- Use proper log levels - Info, Debug, Warn, Error
- Test edge cases - Not just happy path
- Profile performance - Don’t guess, measure
- Write unit tests - Prevent regressions
- Use version control - Commit working states
Next Steps
- Review Project Architecture
- Read Contributing Guidelines
- Learn about Building from Source