Gate to allow only one player to pass through

I think the answer from MBraedley is correct: the best way to handle this scenario (allowing access to a single player at a time) would be to use Command Blocks to teleport one player into and out of your quiz area. You can program a Command Block to teleport the nearest player to a set of coordinates like so:

/tp @p x y z

I don't know what would happen if two players somehow managed to be the exact same distance from the command block (i.e. does just one get teleported, or do they both get teleported since there is a tie for the "closest"). This additional argument may be necessary to limit it to only one player:

/tp @p[c=1] x y z

The next step is to create a circuit whereby clicking an "entry" button will teleport one player into the quiz area, deactivating this button so that it cannot teleport anyone else in until the player exits the quiz area by clicking a second "exit" button, teleporting them out. Here's one such example circuit I just threw together in my survival game:

enter image description here

The blue blocks are buttons that feed their signals into AND gates (green blocks). The outputs of the AND gates will activate Command Blocks (shown here as redstone lamps at the bottom of the image) and will also feed into the input of a T flip-flop circuit (red blocks). The output of the toggle circuit runs behind the red blocks and feeds into an input of each of the AND gates.

When the toggle circuit is in the "off" state (no output, as shown in the image) then the signal from the right button is disabled and the right redstone lamp (i.e. Command Block) cannot be activated. Activating the left button will cause the left redstone lamp to activate and immediately flip the toggle to the "on" state. This will subsequently disable the signal from the left button and reenable the signal from the right button.

This circuit should give you the ability to allow one player at a time to teleport into your quiz area via a button press. Once they reach the end they can then press another button to teleport out and reactivate the entry button for the next player. I'd also suggest enclosing the circuitry and your quiz area in bedrock, so your average player can't mess with any of it.


You might want to consider using command blocks to teleport players from a spawn area to the quiz area, and then again to the player area. The reason I'm suggesting teleporting the players into the quiz area is that you only want one player there at a time in order to ensure that the player that finishes the quiz is the player that's teleported to the playing area. There are a few ways to check if a player is still in the quiz area and hasn't, for instance, logged out.

As for how to actually implement this, I have no idea. Obviously, you'll need to have at least op powers so you can spawn the command blocks. Beyond that, I can't give many details.