Proszę. Funkcja getRandomLoc() jest autorstwa użytkownika ZiemniaQ. Na górze skryptu masz dołączoną niewielką sekcję konfiguracyjną, w której ustawiasz świat oraz zakres dostępnych koordynatów przy teleportacji.
options:
minX: -10000
maxX: 10000
minZ: -10000
maxZ: 10000
world: "world"
function getRandomLoc(xmin: integer=-1000, xmax: integer=1000, zmin: integer=-1000, zmax: integer=1000, world: text="world") :: location:
while {_return} is not set:
set {_x} to random integer between {_xmin} and {_xmax}
set {_z} to random integer between {_zmin} and {_zmax}
set {_loc} to highest block at location at {_x}, 0, {_z} in world ({_world} parsed as world)
if block at {_loc} != water or lava:
set {_return} to {_loc}
add 1 to y-loc of {_return}
return {_return}
on right click on stone button:
loop blocks in radius 1 around clicked block:
loop-block is sponge
teleport player to getRandomLoc({@minX}, {@maxX}, {@minZ}, {@maxZ}, {@world})
stop