I have a dropper which can contain, of course, any items. Assuming I can already target this dropper in a command's target selector, how can I determine what item is in the first slot of its inventory and use that item ID for another command? Alternatively, if this dropper is triggered and spits out the item as an entity, is there a way to determine what type of item the entity is and use that?

Basically, I'm trying to use command blocks to turn a certain dropper into a block-placer. But for that to be useful, it should be able to take whatever type of block the player puts in its inventory and place that. How can I determine what type of block is there? The only way I can think of is to check the inventory for literally every type of block in the game, but that would require over a hundred command blocks and be highly inefficient. Is there a better way?

  • At this point, I don't think this is possible. However, if Mojang were to add advanced scripting tools, (collective oooh) maybe. – Mutantoe Jun 1 '15 at 21:25
  • Aw :c I was afraid of that. I don't foresee Mojang adding much to command block features besides a handful of new commands here and there. Oh, well...so now I've made a block-breaker system with no block placers...it's kind of rendered my work pointless >_< – IceMetalPunk Jun 1 '15 at 21:42

The Command Block Structure

  • In the top left command block: fill ~ ~-1 ~ ~ ~-1 ~ wool 14
  • In the bottom left command block: fill ~ ~1 ~ ~ ~1 ~ redstone_block
  • In the center-left command block: testforblocks ~ ~-1 ~ ~ ~-1 ~ [x2] [y2] [z2] where [x2] [y2] and [z2] are the coordinates of the target dropper.

The dropper on the top is completely unnecessary and is only there because I used this in a tutorial. In the far right command block would be the command you want executed when the two droppers match.

  • 1
    Can you explain what exactly this does? Unless I'm missing the point of it, I don't think this does what the OP is asking for. – DBS Jun 24 '15 at 7:32
  • @DBS What this does is checks for a match between two droppers, which is the only functional possibility in the OP's request for now, without the use of long lines of very complicated redstone that would take literal hours to compose. – Carcass Jun 24 '15 at 12:41
  • Thanks, but this doesn't do what I need. I need to be able to not just check if the dropper has one specific item, but to determine what item (out of any possibility) it has. If I used the "test and check" method like this, I'd need hundreds of command blocks just to detect it, one for each possible item. Thanks, though. – IceMetalPunk Jun 25 '15 at 9:03
  • @IceMetalPunk I can work on a design for that, if needed. It may be possible using blockdata. – Carcass Jun 25 '15 at 15:56
  • @PrOdIgYCaRcAsS That would be great. I haven't figured out how; if you do, please let me know! – IceMetalPunk Sep 13 '15 at 1:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.