REDSTONEPEDIA › Circuits › Toggle switches (T‑flip‑flops)
Toggle switch: press once on, press again off (T flip-flop)
reacts in 2 ticks (0.1 s) · 3 blocks
Press once and the output turns on; press again and it turns off.
handles presses 2 ticks (0.1 s) apart · made of comparator, copper bulb · fits in 2×2×1
Try it
Hold IN under the view for a long press, tap it for a short one: each tap flips OUT on or off (the box marked OUT turns red while the output is on). Press play under the view to watch a demo on a loop; touch any other control to take over.
How this design does it: T flip-flop, 3 blocks: the input powers a waxed copper bulb, which toggles on every rising edge of its power; a comparator on a stone reads the bulb and is the output.
Build it
Download .litematic Download the design as text
The .litematic opens in Litematica (Minecraft 26.3): every block of the design in one region. The text file is the same build written as plain text, block by block.
Blocks used: comparator copper bulb stone
Details: how it works, measurements and properties
In depth
Each input pulse flips the output: the first pulse turns it on, the next turns it off, and so on; between pulses the output stays put. It flips when the input turns on, 2 ticks (0.1 s) later.
It works like a push-button lamp switch: press once for on, press again for off. It accepts input pulses of 1 tick (0.05 s) or longer and follows pulses as fast as one every 2 ticks (0.1 s).
How to try it
Press play under the view to watch the demo on a loop (the badge reads demo with the step it is on; the same sequence is drawn as a timing diagram below). Touch any control to stop it and try the circuit yourself.
To try it: press and hold the IN button of the bar (or the cell tagged IN) to power that input; a quick tap sends a short 2-tick pulse.
Inputs are tagged in lime; the output is tagged OUT: the redstone lamp in that cell (the view adds it to show the output) lights while the output is on (the output strip by the demo badge shows its last 40 game ticks, 2 seconds). Drag to look around, pinch or scroll to zoom, step one game tick at a time with the step button.
Inputs and output over time
The input follows this schedule (the 3D view's demo plays the same). Lime: an input is on; orange: the output is on (taller = a stronger signal, 1 to 15). Time runs left to right in game ticks (20 ticks = 1 s).
Swipe the diagram sideways: the whole sequence lasts 1961 ticks (1 min 38.05 s).
Step by step (29 lines)
A 1 pulse 4: toggled +2 A 2 pulse 4: toggled +2 A 3 pulse 4: toggled +2 A 4 pulse 4: toggled +2 A 5 pulse 4: toggled +2 A 6 pulse 4: toggled +2 A 7 pulse 4: toggled +2 A 8 pulse 4: toggled +2 B pulse 200: toggled +2 B pulse 200: toggled +2 B pulse 30: toggled +2 B pulse 30: toggled +2 B pulse 20: toggled +2 B pulse 20: toggled +2 B pulse 10: toggled +2 B pulse 10: toggled +2 B pulse 3: toggled +2 B pulse 3: toggled +2 B pulse 2: toggled +2 B pulse 2: toggled +2 C period 30: 6 pulses, 6 change(s) C period 20: 6 pulses, 6 change(s) C period 16: 6 pulses, 6 change(s) C period 12: 6 pulses, 6 change(s) C period 10: 6 pulses, 6 change(s) C period 8: 6 pulses, 6 change(s) C period 6: 6 pulses, 6 change(s) C period 5: 6 pulses, 6 change(s) C period 4: 6 pulses, 6 change(s)
Measurements
| metric | value | what it means |
|---|---|---|
| latency | 2 ticks (0.1 s) | the worst time from an input change to the output's change |
| edge | rising | which input edge flips the output: rising = the input turning on, falling = turning off |
| min-pulse | 1 tick (0.05 s) | the shortest input pulse handled correctly (every longer one works too) |
| min-period | 2 ticks (0.1 s) | the fastest train of pulses it follows: one pulse every this many game ticks |
| tileable | every 2 (0 0 2) |
Notes from its designer
T flip-flop, 3 blocks: the input powers a waxed copper bulb, which toggles on every rising edge of its power; a comparator on a stone reads the bulb and is the output. Latency 2 ticks, and it follows pulses every 4 ticks. For a toggle on the FALLING edge, hang the 1-block NOT (a wall torch) on the input block and let the torch power the bulb. A row of them tiles at pitch 2: at pitch 1 the comparators would sit side by side and each one's side input would suppress its neighbour (ComparatorBlock.getAlternateSignal).
Properties
| Study | Toggle switches (T‑flip‑flops) |
|---|---|
| Kind | Toggle switch: press once on, press again off (T flip-flop) |
| Blocks placed | 3 (not counting the input levers or buttons and the lamp the view adds) |
| Box | 2×2×1 (4 blocks of space) |
| Made of (the blocks that change state) | comparator, copper bulb |
| Inputs / outputs | IN (repeater) / OUT |
| The same build is also | every 2nd pulse · 3 blocks (the same blocks, listed as another kind) |
| Design file | tff-bulb |
The design file
Design file (16 lines)
# Toggle switch: reacts in 2 ticks (0.1 s) · 3 blocks # https://vjeux.github.io/redstonepedia/circuits/tff/tff-bulb.html name: tff-bulb circuit: tff tile: 0 0 2 port input: -1 1 0 port output: 2 1 0 origin: 0 0 0 palette: C minecraft:comparator[facing=west,mode=compare,powered=false] S minecraft:stone W minecraft:waxed_copper_bulb[lit=false,powered=false] layer 0: .S layer 1: WC