Take the 2-minute tour ×
Arqade is a question and answer site for passionate videogamers on all platforms. It's 100% free, no registration required.

I would like to command-create a dispenser that contain infinite colored wool.

What I have right now is:

/summon FallingSand ~3 ~1 ~ {TileID:23, Time:1, TileEntityData:{Items:[{id:35, Slot:0}]}}

TileId:23 is the dispenser, and in the Items, id:35 is the wool, but how can I specify the dataValue I'd like to give to the wool?

share|improve this question
1  
Is there a reason you're using falling sand instead of using setblock? Falling sand is old-school now that other options exist. It probably won't solve your problem, but it's something to keep in mind. –  MBraedley Mar 25 at 11:12
    
No, no reason except that's what I've found in tutorials. Now if you have a working solution that uses setblock or anything else, I take it! –  Oltarus Mar 26 at 7:10

1 Answer 1

up vote 1 down vote accepted

To have infinite amount of an item in a dispenser set the count for that item to -1:

/summon FallingSand ~3 ~1 ~ {TileID:23, Time:1, TileEntityData:{Items:[{id:35, Slot:0, Count:-1}]}}

To have a data value for an item in the dispenser, for example coloured wool, use the Data: tag:

/summon FallingSand ~3 ~1 ~ {TileID:23, Time:1, TileEntityData:{Items:[{id:35, Slot:0, Count:-1,Data:0}]}}

Data:0 will make it spawn white wool.

You may also want to switch to the /setblock command. Here is the same with /setblock:

/setblock ~3 ~1 ~0 23 keep {Items:[{id:35, Slot:0, Count:-1,Data:0}]}

As you can see it is much smaller. You can also use the new minecraft:<blockname> format:

/setblock ~3 ~1 ~0 minecraft:dispenser keep {Items:[{id:35, Slot:0, Count:-1,Data:0}]}

If there is already a block there then you might want to change to break:

/setblock ~3 ~1 ~0 minecraft:dispenser break {Items:[{id:35, Slot:0, Count:-1,Data:0}]} 

I also think that it might eventually run out, so you can fill all the slots with the item, unless you are going to have other items in there as well. This should last a long time though so you should be fine. :D

Hope I helped!

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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