Started by
phoenix_wb
on
Topic category: Help with Minecraft modding (Java Edition)
The title is pretty self explanatory, but I just want to make the player teleport when right clicked on an item like a chorus fruit would make it.
Topic category: Help with Minecraft modding (Java Edition)
The title is pretty self explanatory, but I just want to make the player teleport when right clicked on an item like a chorus fruit would make it.
You can generate a random number, and then, you teleport the player to his coordinates plus (or minus) the random nubers
This teleports randomly the player at 5 blocks from his location, max
if (random(0,1) < 0,5): <--- This is a random number to determine if the random range will be minus or plus current x
if (random(0,1) < 0,5): <--- This is a random number to determine if the random range will be minus or plus current z
set (local nx) to random(0,5)
set (local nz) to random(0,5)
move player to x=x+nx, y=y, z=z+nz
else:
set (local nx) to random(0,5)
set (local nz) to random(0,5)
move player to x=x+nx, y=yn z=z-nz
else:
if (random(0,1) < 0,5):
set (local nx) to random(0,5)
set (local nz) to random(0,5)
move player to x=x-nx, y=y, z=z+nz
else:
set (local nx) to random(0,5)
set (local nz) to random(0,5)
move player to x=x-nx, y=yn z=z-nz