Execute command block

Discussion in 'Programming' started by Guilld123, Mar 23, 2020.

  1. Hi, I'm trying to make an automatic door for only 1 player with commands block

    /execute if entity @p[distance=5,name=someone] run setblock -125 71 10 minecraft:stone_button[powered=true]

    I try a bunch of things but I am still stuck into that thing

    Before it was super easy... /testfor @p[name=USERNAME,r=6] with a comparator on the side of it and that's it
     
  2. Hey^^

    You can just place two repeating command blocks with the following commands:
    Code (Text):
    execute if entity @p[name=ksebrt,distance=..5] run setblock -152 36 -54 minecraft:redstone_block
    and
    Code (Text):
    execute unless entity @p[name=ksebrt,distance=..5] run setblock -152 36 -54 minecraft:air
    Just replace the name, distance and coordinate with the fitting data :D