Help with invulnerability

Started by Unmiet on

Topic category: Help with Minecraft modding (Java Edition)

Joined Apr 2024
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Help with invulnerability

I wanted to make a sword that, when the player is holding it, makes them invulnerable to any kind of damage. But by "invulnerable," I mean invulnerable in the sense that the player doesn't take any damage at all; the player has no damage animation. If someone attacks them, it's as if they were attacking a player in creative mode—nothing happens. Can someone give me a hand here please?

Joined Jul 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
I managed to creative this…
Sun, 02/22/2026 - 02:49

I managed to creative this through a procedure using the "When In Inventory Tick" tool trigger.

Procedure which uses "disable damage of <entity> if <bool> otherwise enable it" procedure block and if in main hand to enable/disable damage appropriately

Joined Jun 2025
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
You could try creating a…
Tue, 03/03/2026 - 13:15

You could try creating a potion effect and procedure with a global trigger "Entity is attacked" and add "If entity has active potion <effect name> do Cancel event that triggered global trigger"