Lychee (Neo/Forge)

Lychee (Neo/Forge)

2M Downloads

Does not call IForgeItem#damageItem to handle item damage in DamageItem inputs

Linguardium opened this issue ยท 0 comments

commented

Mod loader

Forge

Minecraft version

1.20.1

Mod version

current codebase as of Sept 2, 2025

Modloader version

47.3.1

Modpack info

N/A

[IMPORTANT] If bug:

  • I have confirmed this bug is reproducible on a minimal setup, not a modpack with many other mods.

[IMPORTANT] If bug: The latest.log file, not the crash report

No response

Issue description

When DamageItem is used, forge's damage handler is not called which can cause issues with items that handle damage in different ways using forge's built-in apis.

// Forge hook
// if (thisEntity instanceof LivingEntity) {
// damage = stack.getItem().damageItem(stack, damage, (LivingEntity) thisEntity, onBroken);
// }

ref: https://github.com/MinecraftForge/MinecraftForge/blob/350bfa51e1b2d56255fed4182b52c5218e8a09af/src/main/java/net/minecraftforge/common/extensions/IForgeItem.java#L720-L732

called from this Forge patch to ItemStack#hurtAndBreak which you seem to be duplicating without the patch, but have added the patch as a comment?
https://github.com/MinecraftForge/MinecraftForge/blob/350bfa51e1b2d56255fed4182b52c5218e8a09af/patches/minecraft/net/minecraft/world/item/ItemStack.java.patch#L163-L166