
CME is Bad - Concurrent Error Debugger for Minecraft
CME is Bad is a specialized mod for diagnosing elusive crashes in Java-based games caused by Concurrent Modification Exceptions (CME) and Index Out of Bounds Exceptions (IOOBE). Unlike standard error reports that only show the current thread stack trace, this tool provides a complete history of changes to the problematic collection.
How the Modification Works
When a critical error occurs, CME is Bad generates a detailed log of the target collection's loading and modification history, allowing precise identification of which thread and mod is causing the conflict. This is particularly useful in multithreaded scenarios common in modded Minecraft environments.
Getting Started
- Place the JAR file in your mods folder
- Add the following line to your Java Virtual Machine (JVM) arguments:
-javaagent:mods/CMESuckMyDuck-<version>.jar=<class_full_name>;<field_name>;<type>;<phase>
- Launch the game - a detailed report will be generated on the next crash
Configuration Parameters
Main Agent Arguments
- Class Full Name: Use slashes instead of dots (e.g.,
net/minecraft/client/audio/SoundEngine
) - Field Name: Name of the monitored field in the target class (use SRG names for Forge)
- Container Type: Supports
List
,Set
, andMap
- Phase:
static
for static fields,nonstatic
for non-static fields
Usage Examples
CME in SoundEngine for Forge 1.16.5:
-javaagent:mods/CMESuckMyDuck-1.0.0.jar=net/minecraft/client/audio/SoundEngine;field_217942_m;Map;nonstatic
CME in PotionBrewing for Forge 1.20.1:
-javaagent:mods/CMESuckMyDuck-1.0.0.jar=net/minecraft/world/item/alchemy/PotionBrewing;f43494;List;static
Advanced Settings
Log Level
System property -Dcme_suck_my_duck.log_level=<level>
controls log detail:
- Level 1 (default) - logs only modifications
- Level 0 - includes debug messages (not recommended, creates massive files)
ASM API Compatibility
For older Minecraft versions (e.g., 1.12.2), ASM API version adjustment may be needed:
-Dcme_suck_my_duck.asm_api_version=5
File Size Limiting
Setting -Dcme_suck_my_duck.file_max_entries=<size>
defines the maximum number of log entries (default 500). Only the last two pages of operations are preserved.
Constructor Whitelist
Allows filtering monitoring for frequently used containers:
-Dcme_suck_my_duck.whitelist_constructor_stacktrace=<string>
CME is Bad transforms the complex task of debugging multithreaded errors into a clear and manageable process, saving time for modpack developers and experienced players alike.