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:
Projectile stuns with shield up

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|