mojira.dev

/execute @e[type=Item] ~ ~ ~ scoreboard players set @e[c=1] Launch 1

When executing a /scoreboard command from an entity (such as an item), and putting @e[c=1] in for the selector in the /scoreboard command, the expected result is for the Item the command is being executed from to receive the score of 1 on the Launch objective.

However, it is the nearest player who has the command executed upon, not the item (or any other entity that is closer than the nearest player). Likely, the problem is that the c=1 argument is looking for the nearest player despite being an argument under the @e selector.

Comments 5

entity selectors are not context sensitive.

@e[c=1] does not relate to the item found in @e[type=item]

Okay.

But then, where is @e[c=1] testing from, if not from the item the command is run at?

Try using "/execute @e[type=Item] ~ ~ ~ /scoreboard players set @e[r=0] Launch 1" if you want the item that is executing the command to set its own score. I tested this out myself and it seems to do what you want.

And you should try adding *type=Item* to the scoreboard command as well to be safe.

This sounds like MC-79103

Or use @p[type=Item]. Anyways, with @e[c=#] I'm pretty sure it selects the # oldest entities, and if the closest player happens to have also been the first player, then they were also the first entity.

Brenden Smith

(Unassigned)

Unconfirmed

Minecraft 1.8.4

Retrieved