Mob still gives debuff effect when I use Shield (2025.3)

Started by BryAstro on

Topic category: Help with Minecraft modding (Java Edition)

Joined Mar 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Mob still gives debuff effect when I use Shield (2025.3)

Hello, I'm trying to make it so that if a shield blocks the player from taking damage from my custom mob, the player won't receive the negative potion effect.

So far, the procedure is like so:

Entity is hurt

 if Is [Source entity] (sub)type of CUSTOM MOB do

  Add potion DEBUFF with level 0 for 100 ticks to [Event/target entity]

The mob gives the debuff just fine, but the problem is even if I block the attack with a shield, it will still give me that debuff.

And if I make the code like so:

Entity is hurt

 if not Is [Event/target entity] blocking

  if Is [Source entity] (sub)type of CUSTOM MOB do

   Add potion DEBUFF with level 0 for 100 ticks to [Event/target entity]

Then it will never give me the debuff if I use my shield, even if I look the other way so that the mob still damages me.

The two extremes seemingly being the only two options I can pick at the moment is the problem, is there a way to make it work properly so that if the attack is blocked, then the debuff will not go through the shield (but only as long as the attack is completely blocked)?