Find entity the player is looking at

Started by Golden64 on

Topic category: Help with Minecraft modding (Java Edition)

Joined Jul 2024
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Find entity the player is looking at

I want to make an item that makes it so when you right click the item it finds an entity the player is looking at and swaps places with them.

 

Joined Apr 2024
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
procedure to detect when the…
Wed, 07/24/2024 - 00:13

procedure to detect when the player is looking at an entity:

https://imgur.com/qZfZp7z 

if you want to change the distance change the first 3 numbers, if you want to change the precision change the last one (too high or too low values may cause bugs, I suggest to use 5 for precision)

Joined Jul 2024
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Thank you
Wed, 07/24/2024 - 02:49

Thank you

Joined Apr 2024
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
You're welcome 
Wed, 07/24/2024 - 02:55

You're welcome