Minecraft Java Edition – How to /execute a Specific Dropped Item and Execute an Armor Stand in 1 Command? [1.12]

minecraft-commandsminecraft-java-edition

So what I wanted to do is this:
/execute @e[type=item] ~ ~ ~ /execute @e[type=armor_stand,name=Chunk,score_Random_min=0] ~ ~ ~ scoreboard players set @s Random 1

Anyway I want the @e[type=item] testing for minecraft:wool 0 like @e[type=item.tile.cloth.white]

Is there a way to do it in 1 command? I know i can do it with 2 like this:
/scoreboard players set @e[type=item] Random 1 {Item:{id:"minecraft:wool",Damage:0s}} and then execute the item with the score and add it to the armor_stand but how to save al that work?

SOLVED: /execute @e[type=armor_stand,name=Chunk,score_Random_min=0] ~ ~ ~ execute @e[type=item,name=item.tile.cloth.white,r=2] ~ ~ ~ scoreboard players set @e[type=armor_stand,name=Chunk,score_Random_min=0,r=2] Random 1 Thanks to Zach K!

Best Answer

To answer the question, there is no way of testing for a specific item through only selectors without the scoreboard in 1.12, which means that no, you cannot execute as a specific dropped item and then execute as an armor stand in 1 command in 1.12. I've always tested for specific item entities through the scoreboard, because I do not know of any other way to do so (unless of course, you can use the name tag like so: "@e[name=item.tile.cloth.white]"; I don't have the ability to test this right now but I assume it doesn't work).

As I was reading the comments of your question though, you are trying to make a randomizer; try to use the "@r" selector effectively (which will select a random entity out of the parameters you give it) before you result to any other form of randomization, as it will save you time (Link to selectors here). Functions will also allow you to save time and compile many commands into, well, a single function (Link to functions here).

EDIT: I just tested this today, you can use names to specify the item. Never knew this until now; cool! The syntax is up above. If you would like to know what item name it has, use "/execute @e[type=item] ~ ~ ~ /say hi" which will give you the names of each item. My randomization paragraph still stands though.

EDIT 2: I realized that the name is entirely based upon your language file! The reason the items are called item.tile.cloth.white is because there is no name for it in the language file. This means that by changing the language, you will need to change the command. You can actually use "/say @e[type=item]" as a shorthand instead of the long command above. I do not know how commands work on servers because I do not have one, but in singleplayer the commands are based on your own language file. Please note this.