Making an item, which teleports you to block you are looking at, but only for set distance

Started by Frumptle on

Topic category: Help with Minecraft modding (Java Edition)

Joined Oct 2025
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Making an item, which teleports you to block you are looking at, but only for set distance
Fri, 10/31/2025 - 08:32 (edited)

Hello, I am trying to make an interesting item - Warper. If you look at a block, you teleport to it, but the block must be solid, you cannot teleport through walls and most importantly - block should be 20 or less blocks away from you, otherwise it won't work.

I tried to make raytracing stuff, but i can't compare a distance - it is only available as an integer.

I am using MCreator 2025.1.

Any suggestions?

Edited by Frumptle on Fri, 10/31/2025 - 08:32
Joined Dec 2014
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
that number would be the…
Fri, 10/31/2025 - 08:54

that number would be the distance