ModsFinder

Dodge Cruel Death

by electroluxv2

Dodge Cruel Death is a Fabric mixin that changes how dropped items behave when an entity drops them, so the item stays alive for a very long time.

FabricClient or server, optionalMIT LicenseOpen source1.21

What it does

The mod injects code into the dropItem method of Minecraft's Entity class. The injected method, named onDropItem, runs after the original method has created and returned the dropped item entity, so the change applies only once the item exists. It receives the dropped stack, whether the item was thrown randomly, whether the entity keeps ownership of it, and a callback object that exposes the original method call and its return value.

When the injected code runs, it first checks whether the dropped item entity is still alive. If it is not, the method returns without doing anything. If it is, the mod sets the item's age to Short.MIN_VALUE + 1. Setting the age to exactly Short.MIN_VALUE would make the item live indefinitely, so the one-step offset leaves the age very low while still allowing the item's lifetime to be counted. The item therefore lasts almost indefinitely.

The mod is published for Fabric only, for the single game version 1.21, and is released under the MIT License as open source. Either side can run it, and neither needs it. Source code and an issue tracker are linked from the project page.

Key features

  1. Dropped item lifetime

    Items dropped by entities receive a very low age value, so they remain in the world for a long time.

  2. Method injection

    The change is made with a Java mixin into the original dropItem method, leaving the rest of the game code untouched.

  3. Alive check

    Only dropped item entities that are still alive are modified; others are left alone.

  4. Post-creation hook

    The code runs once the item is created and returned, so it acts only after a successful drop.

Compatibility

Latest build for each game version and loader.

1.211.1.0
ReleaseBetaAlphaNot available

Only full game releases are shown. This mod publishes no snapshot builds.

Questions

Does Dodge Cruel Death need Fabric API?

The mod is built for the Fabric loader and has no other listed dependency in its brief. It is published only for Fabric and does not have Forge or NeoForge files.

Does the mod have to be installed on the server?

No. Installing it on either side is enough, and neither side needs it, so it works on a client alone or a server alone.

Which game version does Dodge Cruel Death support?

The latest Fabric file, 1.1.0, is for 1.21, published on 2024-07-24. The mod has no files for other game versions.

More from electroluxv2

All projects

What the author says

If the entity that dropped the item is still alive, the method returns immediately and does nothing. This ensures that the rest of the code only executes if the entity is not alive. The code retrieves the returned ItemEntity object from the original dropItem method using cir.getReturnValue(). If the returned entity…
electroluxv2, on the Modrinth page

Official listing

Owner
electroluxv2
Published
2024-07-23
Updated on Modrinth
2024-07-24
Facts verified
2026-10-15