0

I need to use a command block to activate a lever in Bedrock edition. I thought I could use /setblock but the syntax for Bedrock edition doesn't seem to support it:

/setblock <position> <tileName> [tileData] [replace¦destroy¦keep]

I ran into a similar issue with trying to set the state of a redstone lamp recently and discovered that we've been provided with a lit redstone lamp object to use instead. However, no such variant exists for the lever:

Object list for lever in the command suggestions.

How can I activate a lever with a command block in Bedrock edition?

1

As per on the wiki,

enter image description here

You'll want to:

/setblock ~ ~ ~ lever ["open_bit":1,"lever_direction":"north"] replace

(Don't actually /setblock ~ ~ ~ unless you want to replace your command block)

/setblock is supported on Bedrock, but some block have rejigged states and syntax and some commands changed.

Also, you'll need to know which direction your lever is facing.

1
  • Thankfully my design was able to be completed with a redstone comparator instead, but I left my question up to help future readers. Thanks for the answer! – Taco タコス Jun 17 at 1:52
1

While I type this, Bedrock Edition is still utilizing the data value.

Using the official Wiki, just add 8 to the data value to make an unpowered one powered, and just subtract 8 to make it unpowered (for /setblock and the like).

Source: Minecraft Wiki

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.