Updated:
1. Place the seat
execute align xyz positioned ~0.5 ~ ~0.5 run summon minecraft:armor_stand ~ ~0.5 ~ {Invisible:1b,Marker:1b,NoGravity:1b,Tags:["seat"]}
Stand on a bottom-half stair and run it from chat. It centers on the block and puts an invisible stand at seat height. See armor stand commands.
2. Add a right-click box
execute align xyz positioned ~0.5 ~ ~0.5 run summon minecraft:interaction ~ ~ ~ {width:1f,height:1f,Tags:["chair"]}
An interaction entity is an invisible box that remembers who right-clicked it.
3. Seat whoever clicks
# repeat, always active
execute as @e[type=minecraft:interaction,tag=chair] at @s if data entity @s interaction on target run ride @s mount @e[type=minecraft:armor_stand,tag=seat,limit=1,sort=nearest]
# chain, always active
execute as @e[type=minecraft:interaction,tag=chair] run data remove entity @s interaction
on target switches to the player who clicked, who then rides the nearest seat. See the ride command.
4. Stand up and add chairs
Sneak to stand up. Repeat steps 1 and 2 on each stair; one set of command blocks serves every chair.
5. Remove a chair
/kill @e[tag=seat,distance=..2]
/kill @e[tag=chair,distance=..2]
Troubleshooting
- Too high or low: change
~0.5in step 1, for example to~0.3. - Right-click does nothing: check the box sits on the stair and the repeat block runs.
- Bedrock: there is no interaction entity, so this is Java only (1.19.4+).
Check your command
The Command Error Doctor checks common syntax mistakes in your browser.