2
Need /Execute If Help
So I'm creating a Murder Mystery game mode for my server, and I really need some help with one minor part of the command block code.
When players accuse another player, I have it set up so that it detects if the killer is on the "killer" team and has a certain "player number" score, then the player who accuses the killer will win. Is there a way to detect if the player on the killer team has the precise player number score? I know that @e selects all entities and @a selects all players and @p selects the nearest player, but is it possible to have it select if ANY one player has exactly the two values I need?
Thanks in advance, I've been stuck with this for a while now. The code I have works pretty well, but only about 95% of the time.
When players accuse another player, I have it set up so that it detects if the killer is on the "killer" team and has a certain "player number" score, then the player who accuses the killer will win. Is there a way to detect if the player on the killer team has the precise player number score? I know that @e selects all entities and @a selects all players and @p selects the nearest player, but is it possible to have it select if ANY one player has exactly the two values I need?
Thanks in advance, I've been stuck with this for a while now. The code I have works pretty well, but only about 95% of the time.
4
Post the exact command you're using?
/execute if entity @a[team=killer,scores={player_score=#}] run <command>That's pretty much exactly what I'm using, but for some reason it doesn't seem to work 100% of the time, even though everything else seems to be perfect. Is there maybe something I'm missing?
Maybe
/execute as @a[team=killer,scores={player_score=#}] run <command>This is usually used for more than 1 entity/player, but it still works. If you have multiple murderers and you want only 1, put a limit=1 at the end of the selector
