CME is Bad

# Abstract
Players and modpack developers sometimes find the game crashed with `ConcurrentModificationExceptions` (CME) and `IndexOutOfBoundsExceptions` (IOOBE), which only give stacktrace of current thread and are hard to trace which mod causes them. Here’s one of the crashes which is caused by SimpleReloadInstance in 1.20.1 Forge:

![CME from SimpleReloadInstance](https://cdn.modrinth.com/data/cached_images/877cd1d1976b1969fffb619bdbd62b13244e02c8.png)

So this is what the mod is developed for. Players who install this mod and add javaagent to JVM Argument correctly will receive a full log for modification history of a certain collection:

![log of this mod](https://cdn.modrinth.com/data/cached_images/d3d00f23694f96591fc77d8387540d7ce29c078a.png)

# Usage
First, add this jar to mods folder.

Second, edit your Java Virtual Machine Argument in your launcher. Add `-javaagent:mods/CMESuckMyDuck-.jar=;;;`.

Finally, run the game, play and wait until the crash happens.

# Usage for Other Java Projects
This mod can not only be used for Minecraft debugging, but also be utilized to debug other java projects. Similar to Minecraft. The only different step is that you should add gson and asm jar to classpath (`-cp`) before javaagent, and add our `CMESuckMyDuck-.jar` to classpath after javaagent.

# Arguments
##
A full name of the class, which has a container that you would like to monitor. Use “ instead of `.` (a.k.a. the internal name of class).

##
A field name of the container in target class, which you would like to monitor. For Forge, use SRG name. For Fabric, use intermediary name. For NeoForge, use official name.

##
Currently, we only support three containers: `List`, `Set`, `Map`. This argument indicates the type of monitored container.

## `static` or `nonstatic`. This argument indicates the container is a static field or non-static field.

# How to get and
Let’s start with an example.

First, take a look at the stacktrace of CME/IOOBE:

![Replace this with a description](https://cdn.modrinth.com/data/cached_images/f4908f0fb44bc480d0fba4a1714bf9dbca4b8043.png)

Second, read the source code of SoundEngine and confirm which container is facing this issue:

![Replace this with a description](https://cdn.modrinth.com/data/cached_images/26c2eefabbde9a9ce3aea62dbfdf1012d736c16d.png)

Now we know we should monitor map `field_217942_m` (`instanceToChannel` in `SoundEngine`). Keep going.

Third, install this mod, and add “`-javaagent:mods/CMESuckMyDuck-1.0.0.jar=net/minecraft/client/audio/SoundEngine;field_217942_m;Map;nonstatic`” to Java Virtual Machine Argument. Relaunch the game and wait for the next crash.

Finally, open `CMESuckMyDuck.log` file and you will see which thread and which mod has concurrently modified the container.

# Examples (JVM Arguments)
## ConcurrentModificationException from SoundEngine in Forge 1.16.5 Environment
`-javaagent:mods/CMESuckMyDuck-1.0.0.jar=net/minecraft/client/audio/SoundEngine;field_217942_m;Map;nonstatic`

## ConcurrentModificationException from PotionBrewing in Forge 1.20.1 Environment
`-javaagent:mods/CMESuckMyDuck-1.0.0.jar=net/minecraft/world/item/alchemy/PotionBrewing;f_43494_;List;static`

## ArrayIndexOutOfBoundsException from Zeta mod
`-javaagent:CMESuckMyDuck-1.0.0.jar=org/violetmoon/zetaimplforge/event/ForgeZetaEventBus;convertedHandlers;Map;nonstatic`

# Other options
## Log Level
Use system property `-Dcme_suck_my_duck.log_level=` to set custom log level.

Default 1, which means no debug message will be logged.

Users can set it to 0 to output debug message, which is not recommended – query functions like Map#get, Set#containsAll will also be logged when set to 0, and make the file very very long.

## ASM API Version (v1.0.2+)

In order to maintain compatibility with the latest version of Minecraft, this mod is compiled with asm version 9.7. For older versions of Minecraft (such as 1.12.2), API level operations such as ASM_9 cannot be applied, so players need to use `-Dcme_suck_my_duck.asm_api_version=` to modify the ASM API version compatibility. For example, game version 1.12.2: `-Dcme_suck_my_duck.asm_api_version=5`.

## File Max Entries (v1.0.3+)

Since we notice that when crash happens, the last few operations in the log are much more important than the previous ones. So our mod adopts a paging strategy after v1.0.3, and only the last two pages are retained at the end. The number of logs output on each page (that is, the number of operation call stacks) is fixed, and the default value is 500. Players can use `-Dcme_suck_my_duck.file_max_entries=` to modify the maximum number of elements on the page.

## Whitelist of Constructor (v1.0.3+)

Sometimes a container in a certain class is used in many places (eg. CompoundTag#tags). Directly using this mod will cause the log to be too long or the valid content to be replaced by subsequent operations. Therefore, players can specify an additional constructor whitelist to monitor the corresponding container in the corresponding class of a specific module. The default is empty, that is, there is no whitelist. Players can use `-Dcme_suck_my_duck.whitelist_constructor_stacktrace=` to specify it. If any line in the stack trace where the container is constructed includes the content of the whitelist string, the container will be monitored – otherwise, the container will not be monitored, which greatly simplifies the log output information.

## Transform to Thread Safe (v1.0.4+)
Use system property `-Dcme_suck_my_duck.transform_to_thread_safe=true` to transform the field into a thread-safe container.

This is NOT recommended unless you like slowness and don’t want to fix the problem.

## Inject method (v1.0.4+)
Use system property `-Dcme_suck_my_duck.inject_method=true` to switch to inject mode.

If set, you should use `-javaagent:CMESuckMyDuck-.jar=;` and whenever this method is called, you will receive a stack trace in log files.

## Ignore threads (v1.0.5+)
Use system property `-Dcme_suck_my_duck.ignore_threads=;;;…` to ignore some thread that is expected to modify the given container (or call the given method). For example, `-Dcme_suck_my_duck.ignore_threads=”Server thread”`.

## Stop logging early (v1.0.7+)
Use system property `-Dcme_suck_my_duck.stop_logging_if_exception_created=false` to stop logging if critical error occurs.

## Trace ID Updater (v1.0.8+)
Use system property `-Dcme_suck_my_duck.trace_id_updater=;` to update trace ID when calling the given method. This might be useful in inject mode.

## Monitoring Local Variables (v1.1.0+)
Use system property `-Dcme_suck_my_duck.local_var_index=` to monitor local variable at given index in the given method.

If set, you should use `-javaagent:CMESuckMyDuck-.jar=;;`. By the way, the index can be reused by different local variables. So you might have to use `-Dcme_suck_my_duck.match_local_index=` to specify the ordinal of ASTORE operation to indicate which local variable to monitor.

# Conclusion
I like eating peking duck. It’s so delicious!

![Photo by Polina Tankilevitch: https://www.pexels.com/photo/close-up-photo-of-savory-peking-duck-dish-on-a-ceramic-bowl-5848604/](https://cdn.modrinth.com/data/cached_images/d4ce4bba6f0bef8780cd5843390bf3358dd9b55b_0.webp)

Clear wither hearts

Makes** withered hearts clear** to see if they are there or not.

Cleaner Armour Armor HUD Hotbar

Removes the Empty Armor Containers from the HUD, for a cleaner GUI:

Cleaner Armour Armor HUD Hotbar In-Game

vs Minecraft Vanilla:

vs Minecraft Vanilla Armour Armor

Inspired by MC vanilla’s ‘Absorption Hearts’:

Minecraft Vanilla Absorption Hearts

v1.20.2 (latest) and above is compatible with every other resourcepack.

Just select and put this resourcepack above others in order to work.

Circular Logs

# Improve the look of your default Logs with… ↴

![Circular Log’s Logo](https://cdn.modrinth.com/data/cached_images/271d9f58613a83ac09fe634c67d279d0c5ca6e8b.png)

## Adds Vanilla-like circulated Logs Top | No Optifine or other Mods needed!

### It’s supports every Version of the game! (even including Legacy ones)
### And day-by-day will have more and more mods supported!

Supported Mods

• [Abundance](https://modrinth.com/mod/abundance) – by exoplanetary

• [Architect’s Palette](https://modrinth.com/mod/architects-palette) – by Jsburg

• [Biomes O’ Plenty](https://modrinth.com/mod/biomes-o-plenty) – by Forstride & Adubbz

• [The Aether](https://modrinth.com/mod/aether) – by Oz-Payn

• Vanilla Minecraft – by Mojang

• [Wilder Wild](https://modrinth.com/mod/wilder-wild) – by FrozenBlock

ChicknTurtle’s Better Shield

# ChicknTurtle’s Better Shield

[![](https://cdn.modrinth.com/data/vlbXWQ2k/images/e9c906efe95cd82ce2b8eed88c5681af06e993cc_350.webp) ![](https://cdn.modrinth.com/data/vlbXWQ2k/images/862668e82a5838b08cde7bcd046f752a00b333f8_350.webp)
See more in the Gallery](https://modrinth.com/resourcepack/chicknturtles-better-shield/gallery)

[![ChicknTurtle](https://img.shields.io/badge/-ChicknTurtle-f16436?style=for-the-badge&logo=curseforge&labelColor=black&color=f16436)](https://www.curseforge.com/members/ChicknTurtle) [![ChicknTurtle](https://img.shields.io/badge/ChicknTurtle-a?style=for-the-badge&logo=modrinth&labelColor=black&color=1bd96a)](https://modrinth.com/user/ChicknTurtle) [![Downloads](https://img.shields.io/curseforge/dt/907048?style=for-the-badge&logo=curseforge&labelColor=black&color=f16436)](https://www.curseforge.com/minecraft/texture-packs/chicknturtles-3d-totems) [![Downloads](https://img.shields.io/modrinth/dt/vlbXWQ2k?style=for-the-badge&logo=modrinth&labelColor=black&color=1bd96a)](https://modrinth.com/resourcepack/chicknturtles-3d-totems)

## Features
👀 Smaller and lower shield
🛡️ Slightly improved shield texture
🏁 Banners on shields are no longer low quality (credit to [Vanilla Tweaks](https://vanillatweaks.net/))
🖼️ Shields & banners are displayed nicer in item frames
🔧 Center shield in gui slots

## Info

Feel free to modify this pack or include it in a modpack!

[![](https://cdn.modrinth.com/data/8Gv9gm22/dcbdc1fc77706ed17f81436220214b3993d0734f_96.webp)](https://modrinth.com/resourcepack/chicknturtles-3d-totems) [![](https://cdn.modrinth.com/data/8ZVNGHGD/1227343f30e01d9feb5bee328571fba61c3b7ef4_96.webp)](https://modrinth.com/resourcepack/chicknturtles-3d-tools) [![](https://cdn.modrinth.com/data/4fU34F4v/02d76ca13a36c6ef976865b756839bc75862dd24_96.webp)](https://modrinth.com/resourcepack/numbered-levels)

**💚 Make sure to follow!**

ChicknTurtle’s 3D Totems

# ChicknTurtle’s 3D Totems

[![](https://cdn.modrinth.com/data/8Gv9gm22/images/252d4af2435183f56193f6defb1a188f86d90442_350.webp) ![](https://cdn.modrinth.com/data/8Gv9gm22/images/d14436ce448200f673b9dffb2b51fe7d0f8b1c3f_350.webp)
See more in the Gallery](https://modrinth.com/resourcepack/chicknturtles-3d-totems/gallery)

[![ChicknTurtle](https://img.shields.io/badge/-ChicknTurtle-f16436?style=for-the-badge&logo=curseforge&labelColor=black&color=f16436)](https://www.curseforge.com/members/ChicknTurtle) [![ChicknTurtle](https://img.shields.io/badge/ChicknTurtle-a?style=for-the-badge&logo=modrinth&labelColor=black&color=1bd96a)](https://modrinth.com/user/ChicknTurtle) [![Downloads](https://img.shields.io/curseforge/dt/833713?style=for-the-badge&logo=curseforge&labelColor=black&color=f16436)](https://www.curseforge.com/minecraft/texture-packs/chicknturtles-3d-totems) [![Downloads](https://img.shields.io/modrinth/dt/8Gv9gm22?style=for-the-badge&logo=modrinth&labelColor=black&color=1bd96a)](https://modrinth.com/resourcepack/chicknturtles-3d-totems)

## Features

🔥 Totems have a 3D model, including during the pop animation
👀 Totems cover less of your screen
🤩 Glowing eyes*
✨ Custom material support* (set material format to labPBR)
🔮 Supports [Void Totem](https://www.curseforge.com/minecraft/mc-mods/voidtotem) mod

> *Requires compatible mods/shaders

## Info

Shaders used in screenshots: [BSL Shaders](https://bitslablab.com/bslshaders/)
Feel free to modify this pack or include it in a modpack!

[![](https://cdn.modrinth.com/data/vlbXWQ2k/45845988021373eca428a6ef2b9edf4241fc8ba3_96.webp)](https://modrinth.com/resourcepack/chicknturtles-better-shield) [![](https://cdn.modrinth.com/data/8ZVNGHGD/1227343f30e01d9feb5bee328571fba61c3b7ef4_96.webp)](https://modrinth.com/resourcepack/chicknturtles-3d-tools) [![](https://cdn.modrinth.com/data/4fU34F4v/02d76ca13a36c6ef976865b756839bc75862dd24_96.webp)](https://modrinth.com/resourcepack/numbered-levels)

**💚 Make sure to follow!**

Technoblade Never dies!

# Description
This pack supports a wide range of versions, from 1.11 to 26.1!
I’d like you to take a look at the

(https://modrinth.com/resourcepack/change-the-technoblade-skin-to-a-pig./gallery), but unlike the other packs being distributed, this pack not only puts crowns on the pigs, but also dresses them in clothes.
# ****Preview****

![Preview](https://cdn.modrinth.com/data/cached_images/a6cf3a506f337267f7a88cb37becf4bfec5aec6d_0.webp)

Blue Shield

# Blue Shield

This resource pack replaces the default shield with a custom 3D model.

The design uses a blue theme.

No OptiFine required. Vanilla compatible.

## More Shield Themes

– [Black](https://modrinth.com/project/noire-shield)
– [Creeper](https://modrinth.com/project/creeper-shield)
– [Dark Red](https://modrinth.com/project/dark-red-shield)
– [Mirror](https://modrinth.com/project/mirror-shield)
– [Navy Blue](https://modrinth.com/project/navy-blue-shield)
– [Rabbit](https://modrinth.com/project/rabbit-shield)
– [Red](https://modrinth.com/project/red-shield)

Blinding Pumpkin Overlay

You ever wanted to completely blind your foes with a curse of binding pumpkin? Then this is the resource pack for you!

Should work for every version.

It just makes the pumpkin overlay completely black, thats it.
[Alternative Download [PlanetMinecraft]](https://www.planetminecraft.com/texture-pack/blinding-pumpkin-overlay)

Black Hole Moon

# ![Black Hole Moon Logo](https://cdn.modrinth.com/data/cached_images/70511233eddbfab8bc72c01d69e50b295df55a58.png)
Thanks for checking out Black Hole Moon! This Resource Pack will change the boring moon to a Black Hole. Great to prank your friends, or just to change the moon to something else.

## FAQ

### Does this require any external mods?
Nope. This Resource Pack does not need any external mods for it to function properly.

### Can you put this pack on CurseForge?
I do not plan to put this pack on CurseForge, and probably never will.

### On some versions of Minecraft it either says “The pack is too new” or “The pack is too old”
On these versions “supported_formats” in pack.mcmeta was not introduced yet, because of that it looks at “pack_format” and says on the lines of “Pack format 5? (pack format for 1.15.2) That is old. This pack must not work on me anymore” even though the pack supports that version. Best you can do is just ignore it and enable the pack anyway, do the same if it says “pack is too new”.

### Did you make the Pixel Art yourself?
Yes! and you are free to use it on whatever project your working on. Credit would be appreciated, but its not mandatory, just dont copy the Resource Pack outright and publish it claiming its your own.