Blood Magic

Blood Magic

90M Downloads

Mob Sacrifice Array kills players in Creative mode

ChrisThirtle opened this issue ยท 2 comments

commented

Issue Description:

The mob sacrifice array kills players in creative mode who stand too close to it when it finishes crafting, it's that simple. Not sure if that's intended behavior or not, but since I've not seen much talk about the array itself on the GitHub, thought I may as well raise the issue.

What happens:

When the mob sacrifice alchemy array finishes its crafting process, it kills all creatures within its area. This includes players, and players in creative mode.
The mob sacrifice array will not actually function at all if the only living creature in its area is a player, whether they are in survival or creative. So the fact that it kills players is surprising.

What you expected to happen:

I kinda wasn't expecting the "mob" sacrifice array to kill players at all, at least not directly. Just mobs. It doing so to players in survival standing too close to it isn't really a problem though.
I definitely did not expect it to kill people in creative mode though.

Steps to reproduce:

  1. Get into creative mode
  2. Make a mob sacrifice array, so arcane ashes, with a block of redstone and then a piece of redstone dust put into the array.
  3. Throw some redstone dust into the array, anywhere within 5 blocks is strictly sufficient.
  4. Get a mob within 5 blocks of the array and keep it there. Doesn't particularly matter how, so long as the mob has at least 10 health.
  5. Stand within 5 blocks of the array. Just don't pick up the redstone.
  6. Wait for the array to finish crafting (in this instance, the one recipe it has right now, a teleposer)
  7. And now you are dead.

Affected Versions (Do not use "latest"):

  • BloodMagic: 2.3.0
  • Minecraft: 1.12.2
  • Forge: 14.23.4.2705
commented

Further review shows that the mob sacrifice array will not use a wither as a source of health for its supply, but will happily one-shot a wither if it is in the array's area when the recipe completes.
I think I've figured out what the issue is though, in the code. Not sure if it'd be appropriate for me to make a pull request without any actual response from the devs on if this is intended behavior or not.
But basically the array, when killing entities in its area (lines 120-135 of the mob sacrifice array file) doesn't actually check that those entities return something nonzero from getEffectiveHealth() before killing them. So players and bosses, while prevented from being part of the "do nearby mobs have enough health for this recipe" calculation, are still set to -1 hp when the recipe goes through, killing them.

commented

You can create a direct link from code by left-clicking on the line number in Github, then left-clicking on the ... that appear and then on "Copy permalink".

That being said, sacrificing boss mobs is most likely not intended as is sacrificing players for a specifically stated "Mob" sacrifice mechanic.