promotional bannermobile promotional banner

Death Detangler

A Forge 1.20.1 compatibility mod that prevents “downed player” clone leaks and keeps Hardcore Revival, corpse/grave mods, and Curios working together safely.

File Details

death_detangler-1.2.0.jar

  • R
  • Feb 2, 2026
  • 72.95 KB
  • 4.8K
  • 1.20.1
  • Forge

File Name

death_detangler-1.2.0.jar

Supported Versions

  • 1.20.1

Curse Maven Snippet

Forge

implementation fg.deobf("curse.maven:death-detangler-1413428:7564319")
Curse Maven does not yet support mods that have disabled 3rd party sharing

Learn more about Curse Maven

Death Detangler 1.2.0

Major Fixes:

Fixed "Cannot have null removal reason on Clone event!" Error
- **Critical Fix**: Added bytecode-level mixin (`PlayerCloneEventMixin`) that intercepts `PlayerEvent.Clone.getOriginal()` to ensure removal reason is set before AllTheLeaks checks it
- This fix runs at the bytecode level, ensuring it executes before any event handlers, including AllTheLeaks' validation
- The error was occurring because AllTheLeaks checks the removal reason immediately when the clone event fires, before event handlers could set it

Fixed Mixin Injection Failure
- Made Hardcore Revival mixin injection optional (`require = 0`) to prevent crashes if the target method doesn't exist
- Added reflection-based fallbacks for different Hardcore Revival API versions
- Improved error handling for missing Hardcore Revival methods

New Features

Client-Side LocalPlayer Cleanup
- Added proper cleanup handling for `LocalPlayer` instances on the client side
- Prevents LocalPlayer leaks that were appearing in AllTheLeaks reports
- Sets removal reason to `DISCARDED` for client-side players during death/clone events

Mod Reference Cleanup System
- New `ModPlayerReferenceCleaner` utility class that uses reflection to find and clean up player references from other mods
- Handles references from corpse mods, graveyard mods, Hardcore Revival, and other death-related mods
- Prevents memory leaks caused by other mods holding onto old player entities

Death Detangler API
- New public API (`DeathDetanglerAPI`) for inter-mod communication
- Allows other mods (like Calm The Leaks) to query Death Detangler's status and receive cleanup notifications
- Enables better integration and diagnostics

Improvements

Removal Reason Handling
- Now sets removal reason to `DISCARDED` in `onLivingDeath` before the clone event fires
- Ensures removal reason is set early in the death pipeline, preventing timing issues
- Improved handling of already-removed players using reflection when necessary

Forge Version Compatibility
- Updated `forge_version_range` to `[47.4.0,)` for compatibility with all Forge 47.4.x versions
- No longer limited to the specific build version

Code Quality
- Removed debug comments and unnecessary fluff
- Improved error handling and logging
- Better code organization and documentation

Technical Details

- **Mixin System**: Added `PlayerCloneEventMixin` that intercepts `getOriginal()` at bytecode level
- **Event Priority**: Using `EventPriority.HIGHEST` for clone event handling
- **Reflection**: Enhanced reflection-based cleanup for edge cases where direct API access isn't available