𝐏𝐋𝐄𝐀𝐒𝐄 𝐇𝐄𝐋𝐏: How to teleport entity to the nearest block

Started by modbroz on

Topic category: Help with Minecraft modding (Java Edition)

Joined Jun 2024
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
𝐏𝐋𝐄𝐀𝐒𝐄 𝐇𝐄𝐋𝐏: How to teleport entity to the nearest block

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.

Joined Apr 2025
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
there is a procedure…
Sat, 05/31/2025 - 16:01

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.

Joined Jun 2024
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Could you show an image of…
Sat, 05/31/2025 - 16:12

Could you show an image of what the procedure should look like proclarushtaonasat?

Joined Jun 2024
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Please
Sat, 05/31/2025 - 16:12

Please

Joined Apr 2025
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
you can expand on the…
Sun, 06/01/2025 - 04:57

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"