0

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!

8
  • 1
    What exactly is your plan? Why do you funnel execution through the armour stand? "item.tile.cloth.wite" is not a type, it's a name and it's not even the "CustomName". Testing for NBT can be done with /scoreboard commands, if that's what you want to do. Or do you want to test for a certain type of block below the item? Why do you need to do it in one command? Commented May 5, 2018 at 9:37
  • I just wanna know if it could cause I have to made a lot of those command blocks and it would spare me alot of time
    – Bledder
    Commented May 5, 2018 at 10:00
  • 1
    If you need a lot, I would recommend a function. Then you can just copy. Also, you didn't answer my other questions. I still don't understand what your goal is. Commented May 5, 2018 at 10:19
  • Oh, sorry my goal is to make a randomizer that randomizes 4096 armorstands in +- 1 second, I did it but i want to minimize the amount of command blocks so I was wondering how I could do it. Its all about a city generator with customized regions and more things...
    – Bledder
    Commented May 5, 2018 at 12:20
  • For the question as it stands, I agree with Fabian, you would have to use a function(s). As for the added information in the comments, you should put a description of the entire system in the question so that we know what you are trying to do.
    – IronAnvil
    Commented May 5, 2018 at 15:18

1 Answer 1

4

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.

2
  • Well, the ist answer of the @r is not so usefull. Since I have to randomizer +-1000 items in a second I use droppers to summon random items, but the [name=x] thing can be usefull thx
    – Bledder
    Commented May 11, 2018 at 17:02
  • Well, TYSM it works fine! I never know this before xD thanks!!!!
    – Bledder
    Commented May 12, 2018 at 13:41

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .