Deal damage from Provided Damage Source crashing game

Started by Ovations on

Topic category: Help with Minecraft modding (Java Edition)

Joined Jul 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Deal damage from Provided Damage Source crashing game

I wanted to add conditional bonus damage that the player deals when attacking, but the game crashes when I fulfill the condition and attack. The procedure is activated by a global trigger, crashing both when using "Entity Attacked" and "Before Entity Hurt." I have troubleshot the issue, finding that the game crashes only when I use the block "Deal _ damage to _ from source [Provided damage source]." When I deal damage from a different source, it doesn't crash, but obviously the death message doesn't make sense. The game still crashes when I use a set number of damage instead of a variable, or if I deal damage to the source entity instead of the event/target entity. I've tried removing or changing other blocks in the procedure, but the problem seems to just be the Deal Damage from Source block.

 

I am using MCreator 2023.3 and NerdyPuzzle's Geckolib and Tooltip plugins.

Joined May 2024
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Did you find a solution to…
Sun, 08/11/2024 - 11:55

Did you find a solution to this? I'm on the same version and with the same plugins (minus Tooltip)

Joined Jan 2025
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Unfortunately, I tried and…
Sun, 01/12/2025 - 08:16

Unfortunately, I tried and didn't find any useful info in the crash log.
Provided damage source is PLAYER ATTACK("player" in its toString). Block "Deal" might call "Entity Attacked" and "Before Entity Hurt" and execute the procedure again
It seems that your procedure checkes is the provided damage source PLAYER ATTACK BUT it doesn't check is the provided damage source for the first time.
THE PROCEDURE WILL DEAL AGAIN AND CALL ITSELF AGAIN. THE GAME WILL CRASH WHEN IT CANNOT CALL ANYMORE (It might throw StackOverflowException).
You can create a COPY OF PLAYER ATTACK damage source and then deal from the COPY.