How to target entities relative to the executor in scoreboard operations?

How to target entities relative to the executor in scoreboard operations? - Free stock photo of accuracy, aim, archery

I'm trying to make an entity execute a scoreboard operation in minecraft 1.9, the entity should set the score of another entity to it selfs score.

Setting up testing environment:

/summon ArmorStand ~ ~ ~ {CustomName:"setter"}
/summon ArmorStand ~ ~ ~ {CustomName:"getter"}
/scoreboard objectives add test dummy
/scoreboard players set @e[name=setter] test 111

As you can see, @e[c=1] executed by setter should select himself (this is true for every entity):

/execute @e[name=setter] ~ ~ ~ say my name is @e[c=1]
[setter] my name is setter

But when using the selector in an scoreboard operation this doesn't work:

/execute @e[name=setter] ~ ~ ~ scoreboard players operation @e[name=getter] test = @e[c=1] test
No test score for MY-MINECRAFT-NAME found
Failed to execute ...

In the scoreboard operation e[c=1] seems to target me (MY-MINECRAFT-NAME).

Is there any way to achive what I'm trying to do? And why doesn't this work for scoreboard operations?






Pictures about "How to target entities relative to the executor in scoreboard operations?"

How to target entities relative to the executor in scoreboard operations? - A Person Pulling Arrows From Archery Target Board
How to target entities relative to the executor in scoreboard operations? - Man Pulling Arrows from Archery Target Board
How to target entities relative to the executor in scoreboard operations? - Man Pulling Arrows from Archery Target Board



How do you target a specific entity in Minecraft?

The @e target selector is used to target all entities in the game. This includes both players and mobs in the world. Notice that in this last example, we have used [type=enderman] to target only enderman. This value is called a target selector argument and allows us to filter the target.

How do you use the scoreboard operation in Minecraft?

The syntax for the scoreboard would be "/scoreboard objectives add Money dummy" without parenthesis. To place this scoreboard to the sidebar, Minecraft players can then use the command "/scoreboard objectives setdisplay sidebar Money" which should display the scoreboard to the right of the screen.

How do you use scoreboard command?

Once Minecraft players have ensured their cheats are enabled, simply opening the chat window and typing a few words can move entities at will. The syntax, "/tp @e[type=mobtype] (x-coordinate) (y-coordinate) (z-coordinate)" is used to move mobs of a certain type to a particular set of coordinates.



Minecraft Scoreboard Operation Tutorial [1.16/1.17/1.18/1.19] How to Count Entities




Sources: Stack Exchange - This article follows the attribution requirements of Stack Exchange and is licensed under CC BY-SA 3.0.

Images: Kampus Production, Kampus Production, Kampus Production, Kampus Production