How to activate a Redstone lamp with a Command block

How to activate a Redstone lamp with a Command block - Back view of anonymous male worker in bright uniform and helmet cleaning oil truck vehicle while standing on asphalt roadway surrounded by barriers under white sky in town

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?



Best Answer

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.




Pictures about "How to activate a Redstone lamp with a Command block"

How to activate a Redstone lamp with a Command block - Multi storey residential building at night
How to activate a Redstone lamp with a Command block - Building against blue sky in daytime
How to activate a Redstone lamp with a Command block - Cute little girl playing with wooden blocks at table near window at home



How do you get a lit Redstone lamp with commands?

Lit redstone lamp items can now be obtained in singleplayer worlds via the /give command using the respective numeric ID. The direct item form of lit redstone lamps has been removed from the game. It can no longer exist as an item in any way, only as a placed block.

How do I turn my Redstone lamp on permanently?

To light up the corner blocks, we need to power an adjacent lamp directly, by pointing either a repeater/comparator, a line of redstone dust, or a torch (from below!) into it. Simply powering the adjacent lamps (such as by placing a redstone block/torch next to them) won't do.



MCPE Tutorials | Wireless Lamp Using Command Block




Sources: Stack Exchange - This article follows the attribution requirements of Stack Exchange and is licensed under CC BY-SA 3.0.

Images: Erik Mclean, sergio souza, Inga Seliverstova, Tatiana Syrikova