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'm working on a game for my Minecraft server that includes the element of chance.

The idea is that there are 6 buttons. One of them (randomly determined by redstone circuitry) results in wealth, prizes, etc. The other five result in doom.

When you enter the room the doors close initiating the game and beginning the primary circuit which selects which of the 6 buttons is the winning button. How to actually make the circuitry do this is my problem! I've got the door controls, win/lose circuits, and the reset circuit to prepare the room for the next player all worked out, but I'm stumped on how to make redstone do something random.

How can I use redstone to choose one of the 6 buttons to be active, randomly?

share|improve this question
9  
Why was this closed? Asking how to randomly set one of 6 redstone lines active is entirely on-topic. –  SevenSidedDie Aug 8 '13 at 17:00
2  
I agree with @SevenSidedDie - given the other Minecraft redstone questions which get asked, this one seems totally on topic. –  shanodin Aug 8 '13 at 17:11
    
It was hard to read before and very chatty. I've given it a thorough edit to laser-focus it on the RNG issue. –  SevenSidedDie Aug 8 '13 at 17:14
    
@SevenSidedDie whoops, sorry about that. Fixed it. –  Jeffrey Lin Aug 8 '13 at 17:21
    
This question is much better with the edit, worth reopening. –  Resorath Aug 8 '13 at 17:29

3 Answers 3

One of the most common ways to make a real random circuit is to create a very fast clock that quickly cycles through the possible outputs, which will stop as soon as a person pushes a button. If the circuit is fast enough, or hidden from them, then the exact moment they stop the circuit is sufficiently random to serve many applications.

This can be implemented in redstone using a 6-state ring counter that is constantly "ticked" by a clock circuit, with the clock stopped by the latched human input (which in this case, would be the same as your door-open button), so that when they push the button the ring counter stops changing and its output becomes your button-selection data.

Even better, but more complicated, would be to create a memory cell that "captures" the state of the ring counter when the human input button is pushed, and uses the memory cell as the activation data instead, so that the ring counter never has to be stopped from cycling. That would make the ring counter even less predictable, and make the randomness higher quality.

share|improve this answer

Random circuits can be made by putting different items into a dispenser and launching one out. After you determine which one is dispensed, you can reload it into the dispenser.

share|improve this answer
5  
This is an interesting idea, but plenty of room for expansion to make this answer better. –  Resorath Aug 8 '13 at 17:07
    
@Resorath Okay. I'll probably edit in more content soon. –  Timtech Aug 14 '13 at 22:38

You can also use pig spawners to make it random. You could put a pressure plate under each spawner and, whenever a pig hits a pressure plate, that would be the button that is good while the rest would be bad until another pig spawns and hits another pressure plate.

If you don't know how to get pig spawners, since you can't even obtain them in creative mode, all you have to do is use cheats to spawn them in.

If you dont know the ID number of pig spawners, just go to this website: Minecraft ID List. Oh, and by the the way, you will have to put grass next to the spawners since pigs can only spawn on grass.

share|improve this answer
1  
Trouble with pig spawners is that the distance at which the pig spawns is random but skewed to nearer the spawner, making it hard to use for randomisation. And then you have to deal with the times more than one pig spawns at once, and then how to get rid of the pig. –  SevenSidedDie Sep 17 '13 at 23:52

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.