How to control a redstone lamp with command block?

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.

6

3 Answers

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

Inverted:

/setblock x y z minecraft:redstone_lamp

Regular:

/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

2

You Might Also Like