options:
pvp: (Your pvp world)
command /rtp:
cooldown: 5 seconds
cooldown message: &4Stop! &cYou can only teleport to a random location every 5 seconds.
trigger:
if payer's world is not world("{@pvp}"):
set {_x} to round(random number between -10000 and 10000)
set {_z} to round(random number between -10000 and 10000)
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
hope this helps