Minecraft Java Edition – How to Make an Implication Gate Using Command Blocks

minecraft-commandsminecraft-java-editionminecraft-redstone

I have tons of two-lever implication gates in a map I'm making, and in some cases there isn't enough space to place it. The gate, a bit expanded for simplicity, looks like this:

does anyone ever enter image description here?

This setup does not output signal only when input 2 is on and input 1 is off (so it's kind of a reverse implication, but with the same functionality). Currently, my setup takes up 4x2x8 (64) blocks.

How can this gate be simplified and/or compacted? How small can it get with command blocks?

Edit: I found a partial answer, but the command block solution has yet to be found.

Best Answer

Lower: execute if block ~ ~ ~-1 minecraft:redstone_block unless block ~ ~1 ~-1 minecraft:redstone_block run setblock ~ ~1 ~ minecraft:redstone_block Upper:setblock ~ ~-1 ~ minecraft:air

both: repeat, unconditional, always active

Image of command block soluton