

Hi everyone, I need help with a puzzle mechanism I’m building in JAVA version 1.21.11.
I’m trying to make 9 levers light up 12 redstone lamps, in such a way that some lamps overlap others, as shown in the image, for example. When I activate the lever, the orange lamps underneath turn on, but when I activate the light blue lever, the lamp lights up and when I deactivate it, they turn off. However, if I deactivate and then activate the orange lever, all 3 lamps light up.
I tried to do this using command blocks with the following commands:
1 command block:
/execute if block -264 -14 -435 minecraft:lever[powered=true] run setblock -276 -12 -435 minecraft:redstone_lamp[lit=true]
2 command block:
/execute if block -264 -14 -435 minecraft:lever[powered=false] run setblock -276 -12 -435 minecraft:redstone_lamp[lit=false]
repeat
unconditional
always active
But what happened was that the overlapping lights wouldn’t turn on and would only respond to one lever, not two. In other words, the lamp overlapped by the orange and blue ones responded only to the orange lever, not the blue one.
How can I make the puzzle work correctly? And how can I make it so that lighting the correct lamps unlocks a chest?
Thank you very much, everyone!
by Forward_Squirrel6977