(SOLVED) Projectile stuns with shield up

Started by DJ_9999 on

Topic category: Help with Minecraft modding (Java Edition)

Joined Feb 2024
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
(SOLVED) Projectile stuns with shield up
Sun, 08/03/2025 - 10:34 (edited)

So I made a projectile (its just a branch that gets thrown) which stuns an entity or player when it hits them. But the problem is, the stun effect also gets applied when the player has their shield up. Here´s the procedure when it hits something :   (when it hits a block, entity or player)

|repeat (random integer between 0 and max 2 included) times|
|do|     |Spawn dropped item stick at x y z pickup delay 10 despawn Yes|

|repeat (random integer between 0 and max 2 included) times|
|do|     |Spawn dropped item kauri_planks at x y z pickup delay 10 despawn Yes|

|if|| random integer between min 1 and max 3 included < 3|
|do|     |add potion stunned with level 1 for random int between min 1 and max 3 included * 20 ticks to Event/Target entity|

Edited by DJ_9999 on Sun, 08/03/2025 - 10:34
Joined Feb 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Sounds like what you need to…
Sun, 08/03/2025 - 09:31

Sounds like what you need to do is add an IF statement before you execute the stun on the hit player. It should look like "IF NOT is event/target entity blocking THEN"

Joined Feb 2024
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Oh, never realised that…
Sun, 08/03/2025 - 10:33

Oh, never realised that block existed. Thank you for the help!