CHAPTER 10

VENDING MACHINE

images

images

You will need to choose 1 item as a payment for each item sold (for example, 1 diamond or 1 iron for each chicken, cake, or sword you are going to sell). However, hoppers are always enabled when they have no power going into them, which means that anything we put into the hopper will travel to the bottom chest. Therefore we first must disable the bottom hopper.

What You Need:

2 chests

4 hoppers

Colored wool (1 lime green, 1 blue, 2 magenta, 2 orange, 1 cyan)

3 redstone dust

2 repeaters

3 redstone torches

1 comparator

4 wooden swords

63 items of the payment type (for example, 63 iron ingots)

Stacks of the item you are selling (for example, roast chicken)

Additional building blocks for décor, as you like

1.   Dig a hole 5 blocks wide by 4 blocks long that is 4 blocks deep. One of the long sides will be the front, where the vending machine will be.

images

2.   At the bottom of the hole, 1 block in from the left side, place a chest. This is where all the customer payments will end up.

images

3.   Place two hoppers above the chest. Both hoppers should be pointing down.

images

4.   Now dig a two-block-long hole in front of the top hopper.

images

5.   Place two hoppers in this trench. Both should point forward to the hopper in front of it. (In this picture, some of the ground is removed so you can see the correct hopper direction.)

images

6.   Place a chest on top of the front-most hopper. This will be where customers put their payment. Ultimately, the payment will be transferred by the hoppers to the bottom chest.

images

7.   The bottom hopper nearest the bottom chest is where you will place items that decide what kind of payment is needed. However, to work in this contraption, this hopper must be disabled from passing items on. To do this, first place a block (I’ve used lime green wool) next to the bottom chest, and place 1 redstone dust on top of it. This redstone dust, when it is lit up, will power the hopper, stopping it from passing items along.

images

8.   Place a repeater on the ground, pointing toward the green wool. This repeater will help make sure that the signal going to the bottom hopper doesn’t get crossed with other redstone signals in the contraption.

images

9.   One block from the repeater, at the back of the 4x5 hole, place another block (I’ve used blue wool). On the side of the block that faces the repeater, place a redstone torch. The redstone torch powers the block of space that it is in, so its signal can continue through the repeater and to the redstone dust on the green wool, and to the bottom hopper. Also, because the torch is placed on the side of the wool, it can later be powered off by the signal powering the blue wool.

images

10. Now we are going to place redstone that will allow the bottom hopper to be powered off very briefly, when payment is made, allowing the payment to drop to the bottom chest. First place 2 blocks (I’ve used pink wool) behind the chest.

images

11. On the pink wool nearest the chest, place a comparator pointing away from the chest. This comparator will get a signal from the bottom hopper. The strength of the signal depends on the number of items in the hopper. It reaches full strength when the hopper is full.

images

12. On the second piece of wool, place a repeater pointing away from the comparator. This repeater helps prevent the signal from the comparator from getting mixed up with other signals in the contraption.

images

13. Place 2 blocks to the right of the comparator (I’ve used orange wool). On the top of the block closest to the comparator add 1 redstone dust. On the other, place a redstone torch. This torch is sending a full-strength signal to the comparator. Only when the bottom hopper is full will the hopper’s signal to the comparator be equal to the side-signal from the torch. And only then will the comparator produce a signal out its front that will run through the repeater.

images

14. Now we are going to connect the signal that will come from the comparator to the signal that will turn off the hopper. Behind the block holding the repeater on pink wool, place one redstone dust. If a signal comes from the comparator, this redstone will light up, powering off the redstone torch on the blue wool. The signal to the bottom hopper will be stopped for as long as the comparator is sending out a signal.

images

15. Now we are going to connect the same signal from the comparator to a circuit that will allow items to be delivered to the customer. Right above the dust you just placed, place another block. I’ve used cyan wool.

images

16. On the side of the cyan wool that is above the blue wool, place 1 redstone torch.

images

17. Above the torch you just placed, place another block (I’ve used pink wool). On top of this, place another redstone torch. This torch will turn off, because it is receiving a signal from the torch below. When the torch below turns off, it will turn on.

images

18. Place another block above the redstone torch you placed in step 17. (I’ve used yellow wool here.)

images

19. Now lay a 3x2 layer of blocks (I’ve used white wool) as shown.

images

20. On top of the white wool, place 2 blocks (I’ve used light blue wool) as shown. These white and light blue wool blocks are used to hold a redstone timer that will deliver goods to the customer.

images

21. Place a comparator pointing toward the front and away from the yellow wool. Right-click it once to set it to “subtract” mode. The front mini-torch on the comparator will light up to show it is in this mode.

images

22. Place a repeater pointing toward the side of the comparator.

images

23. Place 4 redstone dust on top of the rest of the white and light blue wool blocks. This creates a circular signal from the comparator, over the light blue wool, to the dropper, to the repeater, and back to the comparator.

images

24. Almost done! Fill up the dropper with the items you are selling. You can right-click the dropper and drag items from your inventory. (I’ve used stacks of roasted chicken.)

images

25. Now, right-click the bottom dropper, above the bottom chest, to open up its inventory. In the leftmost slot, place 63 items of the same type you want for payment. I’ve used iron ingots, but you could use any stackable item, like emeralds or diamonds. In the four right slots, place 4 wooden swords. Because swords don’t stack, they fill up these four slots fully so that they can’t be used in the hopper payment transfer. Now the hopper is almost completely full.

images

26. Your vending machine redstone is done! Try it out by placing payment in the top chest. The same number of for-sale items should pop out of the dropper. If you have any problems, go back and check each step carefully. Look out for the way repeaters and comparators point, and how redstone torches are placed (on a block’s top, or on the side of a block).

images

27. Now you can decorate your vending machine. In front of the dropper, place a block of your choice. Decorate it with an item frame and a chicken. The items from the dropper will still pop through to the front of this.

images

28. Place a wall behind the chest and beside the dropper’s decoration to hide the redstone. Add signs to explain what customers should do.

images

29. Keep decorating until you are satisfied. I’ve made a store around the vending machine. I used orange and white wool, light-gray stained glass panes, spruce wood blocks, and an acacia wood door. (Plus lots of item frames with roast chicken in them!) In the back, I’ve enclosed all the redstone in a maintenance area with spruce wood. Inside, there are stairs so you can easily get to the dropper to add goods and to the chest to collect your payment!

images

images

images