How to make player immune to blast damage

Started by CoolGuy97 on

Topic category: Help with Minecraft modding (Java Edition)

Joined Jul 2024
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
How to make player immune to blast damage

Is there any way to make the player immune to explosions like using an attribute or preferably a potion effect


What I’ve tried is a before entity is hurt>if entity is player>if damage type is explosion>return FAIL


But I don’t think it works and it could probably be more efficient 





Thanks, i need to know for my new superhero mod!!!

Joined Dec 2014
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
this seems to work quite…
Fri, 10/25/2024 - 13:42

this seems to work quite nicely

Joined Jul 2024
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
What’s in the snippets??…
Sun, 10/27/2024 - 20:03

What’s in the snippets?? Thank you

Joined Dec 2014
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
wdym what's in the snippet?
Sun, 10/27/2024 - 20:05

wdym what's in the snippet?

Joined Jul 2024
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Like what IS the custom code…
Tue, 10/29/2024 - 13:59

Like what IS the custom code snippet and why do I need them and also if I do need them what’s the cancel event for? Shouldn’t I just use it?

Joined Dec 2014
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
The custom code snippets run…
Tue, 10/29/2024 - 14:02

The custom code snippets run java code. And yes you do need the cancel event block.

You can also, if you want, just nest it instead of using guard clauses as that doesn't require and custom code snippets.

Joined Apr 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
I'm pretty sure that the…
Tue, 10/29/2024 - 15:06

I'm pretty sure that the only code in the snippets is 'return;'