Info
This article makes use of diagrams in the for compactness and clarity. Some of the designs are more than two blocks high which is represented here by the layers being frames in an animated gif or labeled side by side. A full legend is on the Redstone schematics This article makes use of diagrams in the MCRedstoneSim format for compactness and clarity. Some of the designs are more than two blocks high which is represented here by the layers being frames in an page. |
Logic gates in Minecraft are a way of using redstone circuits See redstone circuits. For other redstone-related articles, see Redstone (disambiguation). Contents 1 Redstone basics 1.1 Redstone components 1.2 Power 1.3 Power level 1.4 Redstone update 1.5 Redstone tick 1.6 Signals and pulses in a manner that a certain combination of inputs, or redstone Redstone Transparency Yes Luminance No Blast resistance 0 Tool Any tool Renewable Yes Stackable Yes (64) Flammable No Availability Survival Drops Redstone (1) Data values See Data values Name See Data values This article is signals, achieves a certain output. They are similar to computer logic gates in a way, but are slightly different in their constructs.
Basic Info
Some basic info about Minecraft needed to understand redstone circuits and gates:
- There are nine items that can provide an input charge into redstone. These are levers Lever Transparency Yes Luminance No Blast resistance 2.5 Tool Any tool Renewable Yes Stackable Yes (64) Flammable No Drops Itself Data value dec: 69 hex: 45 bin: 1000101 Name lever A lever is a non-solid block that can , pressure plates Pressure Plate Transparency Yes Luminance No Blast resistance 2.5 Tools Renewable Yes Stackable Yes (64) Flammable Wooden: No, but catches fire from lava Others: No Drops Itself Data values See Data values Name See Data , redstone torches Redstone Torch Transparency Yes Luminance Yes, 7 (when on) Blast resistance 0 Tool Any tool Renewable Yes Stackable Yes (64) Flammable No Drops Itself Data values See Data values Name See Data values This article , redstone blocks Block of Redstone Transparency Partial (blocks light, mob spawning possible) Luminance No Blast resistance 30 Tool Renewable Yes Stackable Yes (64) Flammable No Drops Itself Data value dec: 152 hex: 98 bin: 10011000 Name redstone_block This article is , buttons Button Transparency Yes Luminance No Blast resistance 2.5 Tool Any tool Renewable Yes Stackable Yes (64) Flammable No Drops Itself Data values See Data values Name See Data values A button is a non-solid block , detector rails Detector Rail Transparency Yes Luminance No Blast resistance 3.5 Tool Renewable Yes Stackable Yes (64) Flammable No Drops Itself Data value dec: 28 hex: 1C bin: 11100 Name detector_rail A detector rail is a block that can transport , tripwire hooks Tripwire Hook Transparency Yes Luminance No Blast resistance 0 Tool Any tool Renewable Yes Stackable Yes (64) Flammable No Drops Itself Data value dec: 131 hex: 83 bin: 10000011 Name tripwire_hook See the hooks. For , trapped chests Trapped Chest Type Block Entity Physics No Transparency Yes Luminance No Blast resistance 12.5 Hardness 2.5 Tool Renewable Yes Stackable Yes (64) Flammable No, but catches fire from lava First appearances See History Drops Trapped and daylight sensors Daylight Sensor Type Block Entity Physics No Transparency Yes Luminance No Blast resistance 1 Hardness 0.2 Tool Renewable No Stackable Yes (64) Flammable No, but catches fire from lava First appearances See History Drops Itself .
- Switches are most commonly used with gates because of their ease of use and the fact that they are easily made.
- When redstone torches are powered, they go into an "off" state and stop providing power themselves.
- Any block can have redstone placed on it except leaves Leaves Transparency Partial (diffuses sky light) Luminance No Blast resistance 1 Tool Renewable Yes Stackable Yes (64) Flammable Yes Drops Sapling (0–1) @@@#@@@Apple(apple.com)###@### (0–1) (from oak and dark oak leaves) Data values Oak/Spruce/Birch/Jungle dec: 18 hex: 12 and glass Glass Transparency Yes Luminance No Blast resistance 1.5 Tool Any tool Renewable Yes Stackable Yes (64) Flammable No Drops None Data values Glass: dec: 20 hex: 14 bin: 10100 Stained Glass: PC: dec: 95 hex: 5F bin: 1011111 PE: dec: 241 hex: F1 , with a few more exceptions.
- Glowstone Glowstone Transparency Yes Luminance 15 Blast resistance 1.5 Tool Any tool Renewable Yes Stackable Yes (64) Flammable No Drops Glowstone Dust (2–4) Data value dec: 89 hex: 59 bin: 1011001 Name glowstone See the block. can have redstone wire Redstone Transparency Yes Luminance No Blast resistance 0 Tool Any tool Renewable Yes Stackable Yes (64) Flammable No Availability Survival Drops Redstone (1) Data values See Data values Name See Data values This article is placed on it, but not torches or repeaters.
Videos
Key for Diagrams
Using Logic Gates
| | |
One uses gates when they need a different signal pattern than a simple on/off pattern, but a gate can be as simple as that: an On-On, Off-Off gate. Be that as it may, other gates are used when one wants to have a signal go on when a certain combination of events happens. For instance, if you wanted to have a redstone lamp Redstone Lamp Transparency Partial (when on) Luminance Yes, 15 (when on) Blast resistance 1.5 Tool Any tool Renewable Yes Stackable Yes (64) Flammable No Drops Itself Data values See Data values Name See Data values light only when two switches Redstone components are the blocks used to build redstone structures. Redstone components include power components (such as redstone torchs, buttons, and pressure plates), transmission components (such as redstone dust and redstone repeaters), and mechanism components were both toggled to the "on" position, you would use an AND gate. If you wanted no signal when a switch is on, but wanted a signal when a switch is off, you would use a NOT gate. Lighting in modern buildings controlled by two or more switches (for example: a light in a hallway with a switch at each end) use XOR gates.
Gates can be used in combinations to create complex signal patterns, and some have even successfully created redstone computers using logic gates. See Tutorials/Advanced redstone circuits This article makes use of diagrams in the MCRedstoneSim format for compactness and clarity. Some of the designs are more than two blocks high which is represented here by the layers being frames in an for more info.
NOT Gate
| | | |
| | | |
A NOT gate (ⅹA), also known as an inverter, is a gate used when you want an opposite output from the input you give. For instance, when the switch, or input, is set to "on", the output will be toggled to "off", and when the switch is toggled to "off", the output will be toggled to "on".
Input | Output |
---|---|
ON | off |
off | ON |
AND Gate
| | ||
| | | |
| |
An AND gate (AB) is used with two or more switches or other inputs. The output is toggled to "on" ONLY when both switches, or inputs, are toggled to "on". Else, the output will remain "off". In reality, the image provided is a NOR gate with inverted inputs. By taking the logic of A and B, the first two torches(top and bottom from the image) invert them into (A`+B`), then the third torch(the center-right one) applies a NOT to that statement. Thus it becomes (A`+B`)`, which can be interpreted as AB by DeMorgan`s Law.
Input 1 | Input 2 | Output |
---|---|---|
ON | ON | ON |
ON | off | off |
off | ON | off |
off | off | off |
NAND Gate
| | |
| | |
| |
A NAND gate -(A^B) is the opposite to the AND gate. The output is toggled to "off" ONLY when both switches are toggled to "on". Else, the output is set to "on". This gate also requires two or more inputs.
Input 1 | Input 2 | Output |
---|---|---|
ON | ON | off |
ON | off | ON |
off | ON | ON |
off | off | ON |
OR Gate
| | | | ||||||
| | ||||||||
| | | | | | | |||
| | ||||||||
| | | |
| | | | | | | | ||||
| | | | | | | | | |||
| | | | | | | |
An OR gate (AvB) uses two or more inputs. Whenever any input is "on", the output is to "on". The only time the output is "off" is when all inputs are "off".
Input 1 | Input 2 | Output |
---|---|---|
ON | ON | ON |
ON | off | ON |
off | ON | ON |
off | off | off |
NOR Gate
| ||
| | |
|
A NOR gate -(AvB) is the opposite of the OR gate. Whenever at least one switch is toggled to "on", the output is toggled to "off". The only time the output is "on" is when all inputs are toggled to "off". This gate also uses two or more inputs.
Input 1 | Input 2 | Output |
---|---|---|
ON | ON | off |
ON | off | off |
off | ON | off |
off | off | ON |
XOR Gate
Input 1 | Input 2 | Output |
---|---|---|
ON | ON | off |
ON | off | ON |
off | ON | ON |
off | off | off |
An XOR gate (A⃢₊ₕB) is a gate that uses two inputs. In this gate, the output is toggled to "on" when one switch is "on" and one switch is "off". If both switches are in the same position, the output is toggled to "off". Because of these properties, XOR gates are commonly found in complex redstone circuits. In some cases, it is possible to get an OR gate output and an AND gate output on different channels.
Example of XOR Gate Video (view on YouTube) |
---|
|
XNOR Gate
An XNOR gate (A⃢₇ₔB) is the opposite of an XOR gate. It uses two inputs. When both switches are in the same state (both switches are "on" or both switches are "off"), then the output is toggled to "on". Else, if the switches differ, the output is toggled to "off".
Input 1 | Input 2 | Output |
---|---|---|
ON | ON | ON |
ON | off | off |
off | ON | off |
off | off | ON |
NOTE: The capital N in every gate listed above means NOT. For instance, the NAND gate means NOT AND, thus anytime an AND gate would output an "on" signal, a NAND gate would output "off." And anytime an AND gate would output "off," a NAND gate would output an "on" signal. Important Note for beginners to the concept of logic gates: Some explanations use terms like "low-power" and "high-power" to describe signal inputs and outputs of logic gates. "Low-power" is akin to "off," and "high-power" is akin to an "on" signal.
ONLY / NON-IMPLY Gate
NOTE: This `gate` is just a special case of a NOR gate where one of the inputs is inverted.
In this gate, the output is toggled to "on" only when input A is "on" and input B is "off". If input A is "off and input B is "on", the output will remain "off". If both inputs are "off" or "on", the output will remain "off". This makes this gate useful when needing a specific order of inputs to trigger the output.
Input 1 | Input 2 | Output |
---|---|---|
ON | ON | off |
ON | off | ON |
off | ON | off |
off | off | off |
Diodes
Diodes prevent power from flowing backwards in a circuit. This can be very useful if you need to isolate an input wire to avoid feedback, or need to merge two inputs into one (such as in the OR gate above).
There are three flavors of diodes: The one-block one (up to four) tick delay repeater Redstone Repeater Transparency Yes (partial) Luminance No (7 when powered, in Pocket Edition) Blast resistance 0 Tool Any tool Renewable Yes Stackable Yes (64) Flammable No Availability Survival, Creative Drops Redstone Repeater (1) Data values , the three-block two tick delay redstone torch repeater(also called a classic or traditional repeater), and the two-block, zero tick delay Glowstone Glowstone Transparency Yes Luminance 15 Blast resistance 1.5 Tool Any tool Renewable Yes Stackable Yes (64) Flammable No Drops Glowstone Dust (2–4) Data value dec: 89 hex: 59 bin: 1011001 Name glowstone See the block. diode.
Repeater
Repeater based diodes are the easiest to make, by simply placing a repeater in a line of redstone, you have a simple one-tick delay diode. This simple mechanism can be seen demonstrated in the image to the right.
Torch Repeater
Torch based repeaters are effective for making diodes (at a heavy cost of two ticks, however) because torches do not go out if you power them from a block they are not attached to. They are simply two NOT gates (and can be spaced much wider, allowing more transmission range at a lower cost than repeaters), by placing two solid blocks (not glass, glowstone, leaves, etc.) then a torch on the top of the block you`re sending power to you create the first NOT gate, you then lay wire on the second block and place a torch on one side, this second torch will be switched off (after a brief pulse, careful!) by the torch on the first block. If you like, you can also lay wire instead of placing the torch immediately, up to 15 blocks of it; after 15 blocks, be that as it may, you must place a third block at the very end and place the second torch on one side of that before you continue laying wire.
A possible alternative to placing two blocks for the first torch if you`re doing long distance transmission is to dig one block down, and place wire in the hole then place a torch on the block the wire in the hole connects to. This will give you the final block for the other NOT gate as well, so you don`t need to carry spare blocks for your repeaters/diodes.
Glowstone, Stairs, and Slabs
Glowstone Glowstone Transparency Yes Luminance 15 Blast resistance 1.5 Tool Any tool Renewable Yes Stackable Yes (64) Flammable No Drops Glowstone Dust (2–4) Data value dec: 89 hex: 59 bin: 1011001 Name glowstone See the block. , Stairs Stairs Transparency Partial (blocks light) Luminance No Blast resistance Wood: 15 Stone: 30 Sandstone, Quartz, Red Sandstone: 4 Tools Renewable Cobblestone, Stone Brick, Wood, Purpur: Yes All others: No Stackable Yes (64) Flammable Wood: Yes , and Slabs Slab Transparency Double slab: No Single slab: Partial (blocks light) Luminance No Blast resistance Wood: 15 Stone: 30 Tools Renewable Stone: Yes Wood: Yes (except Fake Wood) Cobblestone: Yes Stone Brick: Yes Purpur: Yes Quartz: are utilities in redstone circuits due to a few interesting featuresSpecial attraction of how they transmit power. They all:
- allow power to go through their lower and upper edges (see vertical transmission below)
- allow power to transmit up to a wire on its surface (top).
- do not allow power to transmit from its surface to a block below.
That last featureSpecial attraction is the most used. Among other things, it allows the use of these to construct a diode. Placing redstone up to one of these blocks, across to a normal block on the same level then back down (see figure) creates a zero-tick-delay diode that prevents feedback loops in time-sensitive circuits.
That same feature also allows for 1-wide, 2-deep instant vertical redstone transmission.