How to make sounds play at certain events?

Started by 0Azi0 on

Topic category: Help with MCreator software

Last seen on 05:23, 14. May 2022
Joined Apr 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
How to make sounds play at certain events?

I’ve been trying to make a mob that when it detects you it does a loud roar, and a little animation to go with it. And while it’s chasing the player I want it to constantly yell and make roaring noises, the problem? I have no clue how to do that, I know how to inport  sounds like walking and ambiance but like how would I make specific sound cues? I’m pretty new to the mod making scene so idk what I’m doing lol. Anyone know how you would do smth like that?

Last seen on 15:44, 30. Jul 2024
Joined Jul 2017
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
most of the more complex…
Thu, 05/12/2022 - 14:52

most of the more complex things can be done with procedures

add a procedure on the tick update of the mob, and check if the mob has detected you

this can be done by checking if there is a player entity in a specific range (in the Entity Data section)

then play the roar sound

if it gets too frequent, you can do a thing where it constantly increases a timer variable by 1, and when the timer = 5 then it resets to 0 and plays the sound, this will make it play every 5 ticks