Here is the command:

execute at <player> run setblock ~ ~-1 ~ minecraft:oak_planks

I've also tried spawning it underneath the command block, but that does not work either.
I did try using /setblock normally, and it does work, so I'm not really sure where I've gone wrong.

Version is 1.17.

  • What are you using in place of <player>? Are you using your username, or a target selector?
    – ginkgo
    Sep 10, 2021 at 23:28
  • Strangely enough, your command also works. Maybe you typed in your username wrong?
    – 65_7a
    Sep 11, 2021 at 3:28

2 Answers 2


I believe your command is correct. You may have typed your username incorrectly.
An alternative to execute at is using execute positioned as <player> run setblock ~ ~-1 ~ minecraft:oak_planks, but this will not work if you are in a different dimension.

Also, make sure you are running the command on a repeat command block.

  • I apologize for that. I edited the command syntax and tested the command. Thank you for pointing out my error.
    – 65_7a
    Sep 10, 2021 at 9:52
  • Very good, thanks for correcting.
    – One 2 Many
    Sep 11, 2021 at 0:32

You need to add as <player>

For example:

execute as <player> run setblock ~ ~-1 ~ minecraft:oak_planks

You also should not need the at <player> when it is being ran by as <player> the cords at set block (~ ~ ~) should do that

You must log in to answer this question.

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