How to make a mob make a sound when it sees you

Started by Withie The Cryptid on

Topic category: Help with Minecraft modding (Java Edition)

Joined Nov 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
How to make a mob make a sound when it sees you

I wanna make a mob that makes a specific sound when it sees you. Is there a way to do that?

I've tried a few things with procedures but they've all failed.

Joined May 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
You're going to have to do…
Tue, 12/27/2022 - 17:35

You're going to have to do something using Raytrace procedures. My best bet would be to make a procedure that triggers on Entity Update Tick, checks if it's your custom entity, then checks if the entity's look angle position is within a certain range of the player's location. You might also want to add some sort of cooldown variable so it doesn't constantly make the noise when the player is in its range of sight.