Redstonery
RedstoneryCircuits › Analog peak memory
Memory circuit

Analog peak memory

Remember the largest signal level seen since clearing.

9 × 5 footprint1 layer22 blocksTested in 4 rotationsJava Edition 26.2
Open in the simulatorBuild it in the game

Layout

Layer 0 (on the floor)
barrel at x 0, z 0comparator [facing=west, mode=compare] at x 1, z 0redstone dust at x 2, z 0comparator [facing=west, mode=subtract] at x 3, z 0stone at x 4, z 0comparator [facing=west, mode=compare] at x 5, z 0stone at x 6, z 0comparator [facing=north, mode=compare] at x 6, z 1stone at x 6, z 2comparator [facing=east, mode=subtract] at x 5, z 2stone at x 4, z 2comparator [facing=south, mode=compare] at x 4, z 1comparator [facing=west, mode=compare] at x 7, z 2redstone dust at x 8, z 2lever [face=floor, facing=north, powered=false] at x 6, z 4redstone dust at x 5, z 4redstone dust at x 4, z 4redstone dust at x 3, z 4redstone dust at x 3, z 3repeater [facing=south, delay=1] at x 3, z 2repeater [facing=south, delay=1] at x 3, z 1repeater [facing=south, delay=1] at x 5, z 3
redstone dustrepeater or comparatorinputcontainersolid blockarrows point where a device sends its output; north is up

How it works

Four comparators and strongly powered corner blocks recirculate a signal without dust attenuation. The cell remembers the highest input strength seen, even when the barrel empties. Clear suppresses both the input and the loop; release Clear to begin a new peak measurement.

  1. Comparators and strongly powered corner blocks recirculate a numeric signal without dust attenuation inside the storage loop.
  2. A higher barrel reading raises the remembered peak; lowering or emptying the barrel does not erase it. Clear suppresses both the input and feedback loop.

Inputs and outputs

  • Inputbarrel signal level (x 0, y 0, z 2)
  • InputClear (x 6, y 0, z 6)
  • Outputretained peak strength (x 8, y 0, z 4)

Blocks you need

7 × comparator, 6 × redstone dust, 4 × stone, 3 × repeater, 1 × barrel, 1 × lever.

Build it in the game: 24 commands

Relative to where you stand, with x running east and z running south. Paste one line at a time into chat, or into a chain of command blocks. The block art is the game's own; the layout is what the page above shows.

setblock ~0 ~0 ~2 minecraft:barrel
setblock ~1 ~0 ~2 minecraft:comparator[facing=west,mode=compare]
setblock ~2 ~0 ~2 minecraft:redstone_wire
setblock ~3 ~0 ~2 minecraft:comparator[facing=west,mode=subtract]
setblock ~4 ~0 ~2 minecraft:stone
setblock ~5 ~0 ~2 minecraft:comparator[facing=west,mode=compare]
setblock ~6 ~0 ~2 minecraft:stone
setblock ~6 ~0 ~3 minecraft:comparator[facing=north,mode=compare]
setblock ~6 ~0 ~4 minecraft:stone
setblock ~5 ~0 ~4 minecraft:comparator[facing=east,mode=subtract]
setblock ~4 ~0 ~4 minecraft:stone
setblock ~4 ~0 ~3 minecraft:comparator[facing=south,mode=compare]
setblock ~7 ~0 ~4 minecraft:comparator[facing=west,mode=compare]
setblock ~8 ~0 ~4 minecraft:redstone_wire
setblock ~6 ~0 ~6 minecraft:lever[face=floor,facing=north,powered=false]
setblock ~5 ~0 ~6 minecraft:redstone_wire
setblock ~4 ~0 ~6 minecraft:redstone_wire
setblock ~3 ~0 ~6 minecraft:redstone_wire
setblock ~3 ~0 ~5 minecraft:redstone_wire
setblock ~3 ~0 ~4 minecraft:repeater[facing=south,delay=1]
setblock ~3 ~0 ~3 minecraft:repeater[facing=south,delay=1]
setblock ~5 ~0 ~5 minecraft:repeater[facing=south,delay=1]
item replace block ~0 ~0 ~2 container.0 with minecraft:stone 64
item replace block ~0 ~0 ~2 container.1 with minecraft:stone 64