Changing the "amount" dependency in the "Before entity is hurt" global trigger

Started by ShadowPlayer51 on

Topic category: Help with MCreator software

Joined Nov 2015
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Changing the "amount" dependency in the "Before entity is hurt" global trigger

I wanted to know if there was some sort of code block that could change the "amount" dependency in the "Before entity is hurt" global trigger. Like if the player was holding a certain item before the damage, you could set the amount to 0.75 what it would have been, or something like that.

Joined Jan 2019
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Sorry, bumping this. This is…
Wed, 08/18/2021 - 13:53

Sorry, bumping this. This is important for me too.

Joined Apr 2019
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
I might be necro, But I also…
Fri, 07/15/2022 - 20:21

I might be necro, But I also would like to know

Joined Jul 2025
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
chatgpt + custom code…
Tue, 07/01/2025 - 14:59

chatgpt + custom code snippet lets you do (almost) everything as long as you know what you're doing

((net.minecraftforge.event.entity.living.LivingHurtEvent) event).setAmount((float) dmg);

inteded for forge 1.18.2 "Before entity is hurt" global trigger but it might work for more versions, just ask chatgpt something like "Can you make this code work on [modloader] [version] [code]" 

(chatgpt code aint the best but we all gotta do what we gotta do)

Joined Apr 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Actually, I think this…
Tue, 07/01/2025 - 15:06

Actually, I think this feature was added without needing custom code at all in the newest MCreator version.