How do I detect if the player is facing the back of an entity?

Started by 8BitBunnie on

Topic category: Help with MCreator software

Active 9 hours ago
Joined Jan 2022
Points:
639

User statistics:

  • Modifications: 1
  • Forum topics: 24
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 78
How do I detect if the player is facing the back of an entity?

I'm trying to make a weapon that deals bonus damage if the player is facing the back of an entity, is there anyway I would be able to detect if the entity is facing away from the player or if the player is facing the back of an entity?

Active 1 year ago
Joined Mar 2021
Points:
586

User statistics:

  • Modifications: 0
  • Forum topics: 3
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 2
This it might be too fetched…
Mon, 07/31/2023 - 04:06

This it might be too fetched, but you can try casting a get entity in cube size, get if you are in the same X or Z coords as it, and check if both are looking in the same direction. That's my idea.

Active 9 hours ago
Joined Jan 2022
Points:
639

User statistics:

  • Modifications: 1
  • Forum topics: 24
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 78
YT_Jack56 Although that'd…
Tue, 08/01/2023 - 00:58

YT_Jack56 Although that'd work, then it'd only if the entity is facing exactly (to the decimal) the same direction of the player which is a bit too strict for me