Started by
XDKaioden
on
Topic category: Help with Minecraft modding (Java Edition)
I want to create an item that replicates a chorus fruit if it was instant but I can't find a way to safely teleport the player and make sure that the player isn't in a block or above air
.
How would I do this???
The image failed to upload earlier, here it is
https://imgur.com/a/n66JShm
First off, I recommend that you understand what local variables are, and that dependencies are not variables that can be overwritten - I say this because it looks like you are trying to use the [x], [y], and [z] dependency blocks in ways that will not work for the current application. I have created a procedure which can be found below that is quite intensive in that it checks every location in a cubed radius until a random roll of 2% is reached, or until each position has been checked. This does cause some momentary lag which will increase exponentially when the radius is increased. The radius can be changed in the first line (it is currently 10).
This will also only check if the blocks are not solid, but you can change these condiitons how you wish.
Alright tysm, but how would i create a local variable???
When you are in the procedure look at the top right of the window. There is a field with a green plus and a red cross. Click the green plus and select 'number' when making all of the variables for this procedure.
I tested it out but for some reason it teleported me to 23 ~ 14 which is past the 10 block radius?? also if im standing on a one high block it doesnt teleport me anywhere