Started by
Isalick34
on
Topic category: Feature requests and ideas for MCreator
I noticed that in the Behavior section of entities, the "Entity Immune to" section doesn't include custom damage types yet, so It would be nice if that was added.
You could use the 'On entity hurt' global trigger, and check if damage source = custom damage AND entity type = entity type you want it to be immune to. Should it return true, cancel the event.
It could still show some effects of damage, but the not the i-frames and the entity won't be hurt overall.
how do you cancel the event?
In 'advanced procedures', you will find a block called 'Cancel event that triggered global trigger'. Because the block only cancels global triggers, it's why you need to use a global trigger for the procedure to work.
oh ok thanks
This actually helps a ton because this allows me to get NBT data from an entity as it dies by canceling the event and then killing them again with the provided damage source.
No problem!
Can anyone provide a screenshot of the block setup for this please? I'm having trouble setting it up.
here's a simple setup
https://imgur.com/a/9m84ihn
I used this too and it worked perfectly in 1.20.1 but now in 1.21.1 the procedure doesn't compile if there is "cancel event that triggered global trigger" in it, and now I am again looking for how to make entities immune to custom damage types.
That's my bad, it should actually be the "Entity is Attacked" Global trigger.
Thank you! Works just as it should with that modification.
Not for me, I tried "entity is attacked", "entity is hurt" and both "entity suffers damage", none compile if there is a "cancel" block in them.
Try going to trigger of the selected entity and apply the procedure to "entity is hurt" trigger if you're applying it to a custom mob