Started by
xXMoksXx
on
Topic category: Help with Minecraft modding (Java Edition)
I want to make an item that will give immunity to a certain type of damage, could you tell me how to create such a procedure?
Topic category: Help with Minecraft modding (Java Edition)
I want to make an item that will give immunity to a certain type of damage, could you tell me how to create such a procedure?
Use entity hurt trigger and return false value when you want to cancel the damage
If this worked, it doesn't anymore.
I also tried that but with "cancel event that caused global trigger".
It worked perfectly in 1.20.1, the entity/player becomes immune to that damage, nothing happens when being attacked by it.
But after updating to 1.21.1 the procedure refuses to compile if there is "cancel event that caused global trigger" in it, even if the global trigger specifically states it is cancellable and there are no warnings.
I still did not find a way to replace it. Setting health to "current health + damage taken" simply doesn't work (doesn't do anything, the damage is dealt normally and no healing happens after).
Now I just tried with this return false and it doesn't do anything either, the damage happens normally.