Updated:
1. Setup (run once)
/scoreboard objectives add jump minecraft.custom:minecraft.jump
/scoreboard objectives add sneak minecraft.custom:minecraft.sneak_time
jump goes up by one per jump; sneak counts ticks spent sneaking. See sneak detection.
2. Place the iron blocks
Stack iron blocks in one column, 5 blocks apart: for example at Y 64, 69 and 74. Each one sits in a floor.
3. Jump to go up
# repeat, always active
execute as @a[scores={jump=1..}] at @s if block ~ ~-0.5 ~ minecraft:iron_block if block ~ ~4.5 ~ minecraft:iron_block run tp @s ~ ~5 ~
# chain, always active (every block below)
execute as @a[scores={jump=1..}] at @s if block ~ ~-0.5 ~ minecraft:iron_block run playsound minecraft:entity.enderman.teleport master @s ~ ~ ~ 1 1.5
scoreboard players reset @a[scores={jump=1..}] jump
The player rises only when there is iron under them and 5 blocks up. The check uses ~-0.5 because the player is slightly off the ground on the jump tick (relative coordinates).
4. Sneak to go down
execute as @a[scores={sneak=10..}] at @s if block ~ ~-0.5 ~ minecraft:iron_block if block ~ ~-5.5 ~ minecraft:iron_block run tp @s ~ ~-5 ~
scoreboard players reset @a[scores={sneak=10..}] sneak
execute as @a at @s unless block ~ ~-0.5 ~ minecraft:iron_block run scoreboard players reset @s sneak
Sneaking for half a second on iron drops one floor. The last line clears sneak time spent anywhere else.
Troubleshooting
- Jumping does nothing: the next iron block must be exactly 5 blocks higher.
- Drops several floors: raise
sneak=10..to 20 for one floor per second. - Bedrock: there are no jump or sneak scores; use a warp plate instead.
Check your command
The Command Error Doctor checks common syntax mistakes in your browser.