command /rtp:
cooldown: 10 seconds
cooldown message: &4Stop! &cYou can only teleport to a random location every 10 seconds.
trigger:
set {_x} to round(random number between -1000 and 1000)
set {_z} to round(random number between -1000 and 1000)
set {_block} to block at location at ({_x}, 0, {_z}) in world event-world
loop all blocks above {_block}:
if loop-block is air:
block below loop-block is not water
block below loop-block is not air
if block above loop-block is air:
teleport player to loop-block
send "&aTeleported to a random location" to player