Started by
gorgin
on
Topic category: Troubleshooting, bugs, and solutions
Whenever anything takes damage with a debuff I made (opposite effect of resistance) the game and mcreator both crash before the damage is dealt.
picture of procedure:
Edited by gorgin on Wed, 07/17/2024 - 14:52
This is because it's damaging the entity twice in the same tick. It checks when an entity is attacked and if the entity has "Vulnerability". If this is true it will deal:
normal damage * ((2x entity vulnerability potion amplifier) * 0.2) to the entity that was attacked with the vulnerability from the PROVIDED damage source (entity attack i think). The problem is the game sees the two things: "entity attacked" (which means the entity was attacked) and then at the same time it damages the entity AGAIN from the same damage source, this is a big no no.
You have to make the procedure wait or cancel or something so it doesnt crash. I think putting the deal damage in a 1 tick wait block would work
That worked, but I had to make a new damage source and damage with that so I could test if the damage source isn't that, so it doesn't repeatedly damage you.
Yeah, that happens with player attack source
would it be possible for you to post a picture of the final code? im having a similar issue