(SOLVED) Game and Mcreator crashes when dealing damage with "entity attacked" procedure

Started by gorgin on

Topic category: Troubleshooting, bugs, and solutions

Joined Dec 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
(SOLVED) Game and Mcreator crashes when dealing damage with "entity attacked" procedure
Wed, 07/17/2024 - 14:52 (edited)

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:

 https://imgur.com/a/procedure-GCB5jsy

Edited by gorgin on Wed, 07/17/2024 - 14:52
Joined Jan 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
This is because it's…
Wed, 07/17/2024 - 04:14

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

Joined Dec 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
That worked, but I had to…
Wed, 07/17/2024 - 14:51

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.

Joined Jan 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Yeah, that happens with…
Wed, 07/17/2024 - 15:58

Yeah, that happens with player attack source

Joined Jul 2024
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
would it be possible for you…
Mon, 07/22/2024 - 00:10

would it be possible for you to post a picture of the final code? im having a similar issue