# How can I make the redstone repeat a task x times and reset it self?

So I'm trying to make a redstone circuit that can repeat a task x amount of times and then reset it self.

I was thinking of using a dropper and a hopper and use the hopper redstone signal (retrieved by a comparator) to check the amount, so lets say I need it to repeat a task 20 times, I place 20 items inside (along with the 3 items that are already inside the hopper, so it emits a 2 long signal once it has the 20 items from the dropper, I know how to do that part, but to the question, how can I make it reset to 3 on the hopper and 20 to the dropper?

The main question is the one described in the first paragraph and the title, the second one would be good to know, but idk if its possible.

• Can you use mods? This would be very simple with RedPower Jun 22, 2014 at 14:10
• No, this is for using in a survival server I'm playing in. Jun 22, 2014 at 15:03
• working on a solution now ;) Jun 22, 2014 at 15:43
• do you have limited space, or can the circuit be as large as needed? Jun 22, 2014 at 16:02
• After working for a couple of hours and searching the internet I'm afraid I can't find a solution. This is probably only achievable with mods, since Minecraft's redstone system is more than a little flawed. Jun 22, 2014 at 17:19

## 2 Answers

As with most counting problems in Minecraft, the answer is eggs.

Take a look at my sample setup.

### Redstone explanation

1. To the right, we have a monostable circuit to shorten the input (the button) down to 1 tick. I use Sethbling's favored design, the repeater is set to 3.

2. The Centerpiece is a Hopper-Dropper-Counter (a hopper and dropper pointing into each other), containing, in this case, 9 Eggs (or anything that stacks to 16) and 10 Cobblestone (or anything that stacks to 64), for a total of 19 items. You realize this is 1 short, but that's actually fine.

3. The comparator turns to 3 when all items are in the hopper. In this case, the torch at the bottom of the picture turns off.

4. The last component is a Repeater-Lock. On each button press, the hopper will update to whatever redstone signal is on the bottom torch before the button was pressed. So if it's at three bars after 19 clicks, it will unlock the hopper on the 20th click, causing all items to go back into the dropper.

To make something happen every 20th click, you should get the signal from the block next to the hopper (i.e. the state of the locked repeater), it is only ever off 1/20 of the time. You could put redstone dust underneath, or put a torch on top, for example (but watch out for signal inversion).

Design notice: I used a variation of this for a three state enchanting room (lvl 1, lvl 18, lvl 30 enchants), using 2 wooden swords, and repeaters checking for a signal >0 and >3, respectively.

• Works perfectly!, thanks a lot. I also made another design, but your is much more compact than mine. I would vote you up, but still don't have 15 reputation :/ Jun 23, 2014 at 20:40

The circuit I ended up with when I came across similar task as question:

Posting just for further readers or something.

• I haven't linked any page. If you mean the image, I am pretty sure it was uploaded on this site while creating the post (ik it's imgur internally, but it's posted via stackexchange). Anyway, I don't play on improving the answer - I don't have time to break it down into details nicely (like the other answer). If it's broken I could work on it. If it's useless it will get downvoted. Dec 12, 2021 at 3:05
• This happens when you review new posts at late night, I thought that was a YT preview and not an actual image. My bad. Dec 12, 2021 at 12:06