How to Use SetBlock Command to Add a Torch in Minecraft

This Minecraft tutorial explains how to use the /setblock command to add a torch with screenshots and step-by-step instructions.

The /setblock command replaces one block with another block. Because a torch can be mounted on a wall or sit on the ground, it makes the command more complicated as you have to set the direction that the torch is facing. Let's explore how to use the /setblock command to add a torch.

Supported Platforms

The /setblock command is available in the following versions of Minecraft:

PlatformSupported (Version*)
Java Edition (PC/Mac) Java Edition (PC/Mac)Yes (1.7.2)
Pocket Edition (PE) Pocket Edition (PE)Yes (0.16.0)
Xbox 360 Xbox 360No
Xbox One Xbox OneYes (1.2)
PS3 PS3No
PS4 PS4Yes (1.14.0)
Wii U Wii UNo
Nintendo Switch Nintendo SwitchYes (1.5.0)
Windows 10 Edition Windows 10 EditionYes (0.16.0)
Education Edition Education EditionYes

* The version that it was added or removed, if applicable.
NOTE: Pocket Edition (PE), Xbox One, PS4, Nintendo Switch, and Windows 10 Edition are now called Bedrock Edition. We will continue to show them individually for version history.

Requirements

To run game commands in Minecraft, you have to turn cheats on in your world.

Minecraft Names and DataValues for Torches

Let's look at the Minecraft Name and DataValues you can choose from in the /setblock command when dealing with torches.

Minecraft Names for Torches

First, you need to decide what type of torch you want to create. There are 2 types of torches in the game:

Item Description
(Minecraft ID Name)
torch Torch
(torch)
redstone torch Redstone Torch
(redstone_torch)

Minecraft DataValues for Torches

Next, you will need to know the DataValue for each direction that the torch can face.

Description DataValue
Torch is facing East (attached to West side of block) 1
Torch is facing West (attached to East side of block) 2
Torch is facing South (attached to North side of block) 3
Torch is facing North (attached to South side of block) 4
Torch is facing Upwards (attached to top of block) 5

When you mount the torch on a wall (ie: the side of a block), you will use a DataValue of 1, 2, 3 or 4, depending on which side of the block you want the torch to be attached to. When you place the torch on the top of a block, you will use a DataValue of 5 so that the torch is positioned upwards from the ground.

Examples

To place a torch that is facing West and attached to the East side of the block (2 blocks East, 2 blocks upwards and 1 block North):

/setblock ~2 ~2 ~-1 torch 2

To place a redstone torch that is facing upwards and attached to the block beneath it (3 blocks East and 1 block South):

/setblock ~3 ~ ~1 redstone_torch 5

How to Enter the Command

1. Open the Chat Window

The easiest way to run a command in Minecraft is within the chat window. The game control to open the chat window depends on the version of Minecraft:

  • For Java Edition (PC/Mac), press the T key to open the chat window.
  • For Pocket Edition (PE), tap on the chat button help command at the top of the screen.
  • For Xbox One, press the D-Pad (right) xbox one on the controller.
  • For PS4, press the D-Pad (right) ps4 on the controller.
  • For Nintendo Switch, press the right arrow button nintendo switch on the controller.
  • For Windows 10 Edition, press the T key to open the chat window.
  • For Education Edition, press the T key to open the chat window.

2. Type the Command

Now, let's look at examples of how to use the /setblock command. The first example will show how to mount a torch on the wall and the second one will show how to mount a torch on the ground.

Mount Torch on a Wall

First, let's start by adding a torch to the side of a block so that it is mounted on the wall. If we wanted the torch to be facing West and attached to a block on the East side, we could use the following /setblock command:

/setblock ~2 ~2 ~-1 torch 2

Type the command in the chat window. As you are typing, you will see the command appear in the lower left corner of the game window. Press the Enter key to run the command.

setblock command

This /setblock command would replace the block at the coordinate ~2 ~2 ~-1 with a torch. This coordinate is the block that is 2 blocks East, 2 blocks upwards, and 1 block North of our current location.

For the replacement block, we use a name of torch and a DataValue of 2 to represent a torch that is facing West and attached to a block on the East side.

completed setblock command

You will see the message "Block placed" appear in the lower left corner of the game window to indicate that the /setblock command has completed. Now you should see the torch mounted on the wall.

Place Torch on Ground

Now let's show how to add a torch that is sitting on the ground.

We could add a redstone torch that is facing upwards and attached to the block beneath it with the following /setblock command:

/setblock ~3 ~ ~1 redstone_torch 5

Type the command in the chat window and press the Enter key to run the command.

setblock command

This /setblock command would replace the block at the coordinate ~3 ~ ~1 with a redstone torch. This is the block that is 3 blocks East, 0 blocks upwards, and 1 block South from our current location.

For the replacement block, we use a name of redstone_torch and a DataValue of 5 to represent a redstone torch that is facing upwards and attached to the block below it.

completed setblock command

You will see the message "Block placed" appear in the lower left corner of the game window to indicate that the /setblock command has completed. Now you should see the redstone torch sitting on the ground.

Congratulations, you have learned how to use the /setblock command to add a torch or redstone torch in Minecraft.

Other SetBlock Cheats

You can use other setblock commands in Minecraft such as: