I'm creating a custom data pack. Basically I want commands to run when the ball is within 1 block of the red marker.

These first 5 commands work great!

execute as @e[type=marker,name=Red] at @s if entity @e[type=armor_stand,tag=Ball,distance=..1] run particle minecraft:totem_of_undying ~ ~2 ~ 1.5 1 1.5 0 250 force
execute as @e[type=marker,name=Red] at @s if entity @e[type=armor_stand,tag=Ball,distance=..1] run playsound entity.firework_rocket.twinkle_far ambient @a ~ ~ ~ 30000 1
execute as @e[type=marker,name=Red] at @s if entity @e[type=armor_stand,tag=Ball,distance=..1] run tellraw @a {"text":"Blue DUNKED on Red!","color":"aqua","bold":true}
execute as @e[type=marker,name=Red] at @s if entity @e[type=armor_stand,tag=Ball,distance=..1] run scoreboard players add Blue Score 1
execute as @e[type=marker,name=Red] at @s if entity @e[type=armor_stand,tag=Ball,distance=..1] run tp @e[type=armor_stand,tag=Ball] -194 3 87 facing -194 4 87

But these last 3 don't work at all. What is going on?

execute as @e[type=marker,name=Red] at @s if entity @e[type=armor_stand,tag=Ball,distance=..1] run spreadplayers -193.58 75.61 3 3 true @p[team=Red]
execute as @e[type=marker,name=Red] at @s if entity @e[type=armor_stand,tag=Ball,distance=..1] run effect give @p[team=Red] minecraft:slowness 3 255 true
execute as @e[type=marker,name=Red] at @s if entity @e[type=armor_stand,tag=Ball,distance=..1] run effect give @p[team=Red] minecraft:jump_boost 15 127 true
New contributor
Iceypoo is a new contributor to this site. Take care in asking for clarification, commenting, and answering. Check out our Code of Conduct.
  • This is an interesting question, but could you please expand on what exactly you mean by "not working"? Are there error messages, or do the commands work but do nothing? Also please explain what you expect for each of the non-working commands to do if they did work. Sep 12 at 23:15
  • @ExpertCoder14 By "don't work at all", I mean there is no error message, nothing happening, therefore it just doesn't do anything. Even in a command block. The first of the 3 commands should spread all of team red around the set coordinates. The 2nd should keep you from moving The 3rd should keep you from jumping
    – Iceypoo
    Sep 12 at 23:27

One of the things that doesn't work that is common to all three of the failing commands you provided is the target selector @p[team=Red]. This means that only the nearest player is selected that is on the team, not all the players.

@a will ensure that all players matching the filters are selected.

  • Thank you for pointing that out! Still though, that's not the main issue, since I'm the only person on my server.
    – Iceypoo
    Sep 12 at 23:33

Your Answer

Iceypoo is a new contributor. Be nice, and check out our Code of Conduct.

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.