Minecraft – How to create an RS-NOR latch with a toggle input in addition to the standard “On” and “Off” buttons? [JAVA EDITION]

minecraft-java-editionminecraft-redstone

Upon request from multiple moderators/experts, this question has been split into two identical questions, one for each of the two main versions of Minecraft. This question is for solutions for Java Edition. If you have a solution for Bedrock Edition, please post it here.


I am creating a redstone contraption that is based off an RS-NOR latch and a T-flip-flop at once.
The contraption needs to have three pulse-based inputs and one output.

Here are the inputs and their descriptions of what they should do:

  • "On" button: Turn the output on, or keep it on if it is already on.
  • "Off" button: Turn the output off, or keep it off if it is already off.
  • "Toggle" button: Toggle the state of the output, no matter what state it was in before.

The toggle button should provide only a temporary inversion, with the next button press acting as normal.

Here are the questions I would like to have answered:

  • Should my redstone contraption be based off a T-flip flop, a RS-NOR latch, or neither?
  • What is the most compact way to construct a redstone contraption like this?

Please include images with your solution.

Best Answer

What you're looking for is still going to be based primarily around an RS latch, with a couple of AND gates to make the toggle line work properly. For this, the circuit diagram looks like this:

Circuit diagram consisting of an RS latch and a pair of AND gates

Breaking it down, you have an RS latch hooked up as normal. From there, you need the output and an inverted output to control two AND gates that control which input the Toggle is meant to control. That is, if the RS state is on, your toggle should control the off side of the RS latch.

I'm sure this could be done more cleanly, but the circuit I came up with is this:

The above circuit implemented in Minecraft

Note that in the above there are sticky pistons underneath the gold blocks which act as AND gates, and a redstone repeater underneath the diamond block to keep the signal from the repeater on the Reset line from being directly connected to the Output line. Here's a closer look at that portion of the circuit:

Closer look at the AND gates and the repeater in the Q line