Minecraft – What exactly does “/scoreboard @a = @a ” do

minecraft-commandsminecraft-java-edition

I'm developing a multiplayer minigame, but haven't been able to get any of my friends to help me on testing yet. I need to set EVERY players internalCash score to their cash score, but cannot use /execute, since it needs to run for non-op players.

It would be INCREDIBLY elegant if I could simply use

/scoreboard players operation @a internalCash = @a cash

but it doesn't seem to work properly with @e, which scares me. Could someone please tell me if I need to develop a clever workaround for this, or if this will do.

edit Oops! Kinda need the "players operation " part. 😛

Best Answer

/execute does not require the targets to be OP'd and is very necessary to use in order to do what you're trying to do. /scoreboard operations requires one of the two selectors to resolve to a single target, so you cannot use @a with @a.

Using /execute:

/execute @a ~ ~ ~ scoreboard players operation @a[c=1] internalCash = @a[c=1] cash