I have to control lamps with a sun light detector. However, the location of the lamps is very special so I have difficulty to place the redstone line. I wonder if there is a way to control the lamps with a command block remotely?

I need to keep them on during the daytime and turn them off at night.

  • @dly Actually I don't see the connection between the command you posted and my question......
    – Yijun Yuan
    Commented Aug 4, 2016 at 13:57
  • @dly This question is primarily how to turn on/off the lamp remotely, which your link doesn't seem to answer at all.
    – SirBenet
    Commented Aug 4, 2016 at 14:40
  • Would it be fine to have one block adjacent of the lamp, or does it need to be completely on its own?
    – SirBenet
    Commented Aug 4, 2016 at 15:22
  • I'm not sure if they removed this, but try /setblock and change the lamps into powered_lamps
    – Daniel G
    Commented Aug 4, 2016 at 15:38
  • @colorfusion It's not a lamp, it's several lamps which are placed specially so I'm unable to place power source or redstone line to enlighten them( setting a block adjacent of the lamp seems to be impossible too) together with the same control structure. So it has to be remotely.
    – Yijun Yuan
    Commented Aug 5, 2016 at 0:00

3 Answers 3


Use two command blocks, one connected to a daylight sensor and one to an inverted daylight sensor. Set them both to repeat.


/setblock x y z minecraft:redstone_lamp


/setblock x y z minecraft:lit_redstone_lamp

x, y, and z are the coordinates of the lamp. No blocks around the lamp are required.


In the current version of Minecraft, you need to use this command

/setblock x y z minecraft:redstone_lamp[lit=true]

My easy solution:

Enter this to the right command block:

Minecraft screenshot

The X Y Z should correspond to a block adjacent to the redstone lamp.

You get the inverted daylight sensor by right-clicking on a regular one.

Here are the commands for pasting:

Right command block: /setblock x y z minecraft:air 0

Left command block: /setblock x y z redstone_block

  • lol I made one 8 step tutorial before I realized that I can do it like this it took me 3 hours and this tooke me 5 minutes lol
    – technikfe
    Commented Aug 5, 2016 at 13:44
  • as compact as it can get I think
    – technikfe
    Commented Aug 5, 2016 at 13:53

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .