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 

Joined Jan 2025
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
which tab is that in
Fri, 02/21/2025 - 01:23

which tab is that in

Joined Jan 2025
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
nvm found it
Fri, 02/21/2025 - 01:24

nvm found it

Joined Jan 2025
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
is it possible to do that if…
Fri, 03/14/2025 - 10:06

is it possible to do that if player looking at the entity the entity attacks? (like an enderman?)