How to activate a Redstone lamp with a Command block

I'm trying to make a tower of redstone lamps. Is it possible to activate one of them without activating another lamp with a command block, and if there is, what code can I use to connect a Command block to a redstone lamp?


Light a single lamp

You can use a command like this:

/setblock 100 100 100 minecraft:redstone_lamp[lit=true]

The redstone lamp will turn back off after it receives a block update, so make sure to test your setup propperly. If this doesn't work for your setup, then try to use a repeating command block.

Light multiple lamps in a certain volume

You can use a command like this:

/fill 100 100 100 110 110 110 minecraft:redstone_lamp[lit=true] replace minecraft:redstone_lamp

It will light all the redstone lamps within the specified area. If lamps that get lit with this command touch eachother, they will provide a block update for each other and they will turn off again. You can use a repeating command block to solve this issue, too.