Started by
modbroz
on
Topic category: Help with Minecraft modding (Java Edition)
I am trying to make my entity teleport to the nearest specific block. If anyone is able to help me I would really appreciate it.
Topic category: Help with Minecraft modding (Java Edition)
I am trying to make my entity teleport to the nearest specific block. If anyone is able to help me I would really appreciate it.
there is a procedure template, that checks for a specific block within a 6x6x6 box. you can modify that template, to be of any size, as long as you make sure, that the ratio stays the same. like changing the numbers from 3-6 to 8-16, if you want to check for an area the size of a chunk. you might want to verify, that the block above matching blocks is air, by adding +1 to the offset y-coordinate.
Could you show an image of what the procedure should look like proclarushtaonasat?
Please
ive found a reddit post with links to pictures https://www.reddit.com/r/MCreator/comments/1flcpa2/how_to_detect_a_block_in_a_radius/
you can expand on the procedure, by putting the yellow blocks into an AND block to also check if the block above those same coordinates is air, by copying the same coordinates, and just adding a +1 to the y coordinate. the teleport block should go in the place where it says set logic found to true, and also use the coordinates of the airblock. you find the teleport block under entity procedures - actions, it should be the fourth block from the bottom "set location of eventtargetentity to xyz"