Charm of Life + death by Sacrificial Dagger = Lost Inventory
qrss opened this issue ยท 3 comments
Forge version:
Twilight Forest version: 3.8.654
Blood Magic version: 2,3,3-101
Log:
Does not contain anything useful.
Steps to reproduce:
- Have Charm of Life I or Charm of Life II in inventory.
- Use the Sacrificial Dagger from Blood Magic near a Blood Altar until you die.
What I expected to happen:
Be saved from death by the Charm of Life.
What happened instead:
You die and lose your inventory. The Charm of Life trigger sound and animation plays. The death is not really the issue, but the loss of inventory is.
Normally when you kill yourself with the sacrificial dagger, your inventory drops to the ground (unless a gravestone mod is installed and puts it in a grave).
Blood Magic code:
I know nothing about modding Minecraft, but looking at the code for using the Sacrificial Dagger, there is this bit:
player.setHealth(Math.max(player.getHealth() - 2, 0.0001f));
if (player.getHealth() <= 0.001f) {
player.onDeath(DamageSourceBloodMagic.INSTANCE);
player.setHealth(0);
}
Perhaps it somehow causes you to die twice in a row, cancelling the Charm of Life effect? No idea why that would cause the inventory to disappear though.
Note that Blood Magic's own Death Save mechanism (Grim Reaper's Sprint on Living Armor) also does not save you from death by Sacrificial Dagger, however it does not cause your inventory to be lost.
As far as I can tell, this is on Blood Magic's end. The inventory doesn't drop because the charm cancels the death event, but then you die anyway.
The dagger code should probably do this instead:
player.setHealth(0);
player.onDeath(DamageSourceBloodMagic.INSTANCE);