Blood Magic

Blood Magic

90M Downloads

Inventory deleted on death by self-sacrifice in combination with death-preventing measures and/or tombstone mods

GrimMa5on opened this issue ยท 3 comments

commented

Issue Description:

Note: If this bug occurs in a modpack, please report this to the modpack author. Otherwise, delete this line and add your description here. If this is a feature request, this template does not apply to you. Just delete everything.

What happens:Hey just wanted to make sure your aware of a certain interaction with some other mods. When you have Eyes of Death Collection from mahou Tsukai up and then go into Blood magic if you Sacrifice you blood and kill your self without meaning it it just completely deletes your inventory and leaves no gravestone from coral tombstone. Im going to report this to all three mod pages as im not sure what part of the interaction caused this but as it has ruined my game today i just wanted to make sure it was known.

What you expected to happen: Not to die as the Death collection acts as a totem of undying in all other situations.

Steps to reproduce:

  1. Have the three mods i mentioned and then get the eyes up
  2. use the dagger and kill yourself
  3. loss everything
    ...

Affected Versions (Do not use "latest"):

  • BloodMagic:
  • Minecraft:
  • Forge:
commented

Hi - what versions are you using for Blood Magic, Mahou Tsukai, and Corail Tombstone? Also, what version of Forge are you on?

commented

Hi, I'm the mahou dev, figured I'd chime in - I think this is likely because of the following code in ItemSacrificialDagger:

			player.attackEntityFrom(DamageSourceBloodMagic.INSTANCE, 0.001F);
			player.setHealth(Math.max(player.getHealth() - 1.998F, 0.0001f));
			if (player.getHealth() <= 0.001f && !world.isRemote)
			{
				player.onDeath(DamageSourceBloodMagic.INSTANCE);
				player.setHealth(0);
			}

It seems like you may be killing the player twice here. The first death would likely be cancelled by souls from mahou, and then a second death may be occurring afterwards, once you do player.setHealth(0), on the next tick. The setHealth method just changes entity data and doesn't actually run any of the "on death" stuff immediately, though, so it's possible something weird is happening because of that.

People in Mahou usually have more than one soul, so it's a bit weird that the player dies anyway and loses inventory. I don't really know how Corail works either enough to comment on the inventory deletion thing.

On the latest Mahou version, I bumped up the priority of death cancellation, so if the cause of it was that Mahou is cancelling death too late in the event pipeline and not notifying BM and CT, that would be fixed, but I don't know if that is actually the cause

commented

Hmm, I'll look at changing how the logic works, then. I'm directly setting the health, etc, due to having issues in the past where mod armours would still mitigate the damage from sacrificing. I suppose one way to go about it would be to change it so that I deal armour-bypassing damage to the player, and then check how much health they actually lost; if the player has armour that still takes the hit, so to speak, it will give less LP. Possible issue with that is I'd need to check if vanilla enchants affect that...