How do I make a procedure occur when the player takes damage?

Started by Bobh Hob on

Topic category: Help with MCreator software

Active 1 year ago
Joined Mar 2023
Points:
189

User statistics:

  • Modifications: 0
  • Forum topics: 3
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 3
How do I make a procedure occur when the player takes damage?

I've been trying many things and all of them failed, I want to add a mechanic that makes it so there is a chance that the player gains a status effect whenever he takes damage, however I cannot find any global procedure of anything else that detects whenever the player takes damage. I have tried to make a procedure where when any entity takes damage they gain a status effect, but that crashed my game multiple times so It cannot be that. Any help, please?

Active 5 months ago
Joined Jun 2023
Points:
251

User statistics:

  • Modifications: 0
  • Forum topics: 6
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 174
Global trigger : before…
Sun, 10/08/2023 - 12:36

Global trigger : before entity hurt

Procedure: if entity = player

Do apply potion effect

Active 1 year ago
Joined Mar 2023
Points:
189

User statistics:

  • Modifications: 0
  • Forum topics: 3
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 3
I'm sorry, which blocks do…
Sun, 10/08/2023 - 19:46

I'm sorry, which blocks do the "if entity = player"?
I might be blind, but I'm not finding them

Active 1 year ago
Joined Mar 2023
Points:
189

User statistics:

  • Modifications: 0
  • Forum topics: 3
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 3
Nevermind, got it 
Sun, 10/08/2023 - 21:47

Nevermind, got it 

Active 5 months ago
Joined Jun 2023
Points:
251

User statistics:

  • Modifications: 0
  • Forum topics: 6
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 174
https://imgur.com/a/8iVQe6w …
Sat, 10/05/2024 - 21:14

https://imgur.com/a/8iVQe6w

"Is [Event/target entity] (sub)type of {Player}" - You can find it in the Logic tab all the way at the bottom

Active 2 months ago
Joined Sep 2023
Points:
115

User statistics:

  • Modifications: 0
  • Forum topics: 1
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 4
I think "Before Entity is…
Fri, 12/13/2024 - 08:00

I think "Before Entity is hurt" is now "Entity is hurt" because i cant find before entity is hurt but the other one.

Active 2 months ago
Joined Sep 2023
Points:
115

User statistics:

  • Modifications: 0
  • Forum topics: 1
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 4
Also how do i do that it…
Fri, 12/13/2024 - 08:04

Also how do i do that it only counts Mob attacks and not hunger, if i get damage from starving now i also get the effect...

Active 2 months ago
Joined Dec 2024
Points:
11

User statistics:

  • Modifications: 0
  • Forum topics: 0
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 1
Use "Is [Provided damage…
Fri, 12/13/2024 - 12:49

Use "Is [Provided damage source] of type [Starve]" It means whether the damage source is hunger.