Mob Invincibility after being hit

1.2k Views Asked by At

I have created a datapack that allows me to shoot arrows at a firerate of 20 shots/second. However I learned that there is a small invincibility frame of approximately 0.5 second everytime a mob gets hit, rendering my weapon's high firerate completely useless. I have tried setting the {HurtTime} tag to 0s with execute as @e run data modify entity @s HurtTime set value 0s, but it won't work. I acknowledge that I can achieve this by using mods but I want to know if there is a way to remove this invincibility frame using in game commands.

1

There are 1 best solutions below

2
Elikill58 On

You can try multiple ways :

  1. With code. You have the same question with code here

  2. Edit your command (Info) to :

    execute as @e run data modify entity @s {HurtTime:0s}
    
  3. Another code edit: use entity.setNoDamageTicks(0) or something like that

  4. If nothing works, you should ask it on Arqade