Mob with multiple (random) ambient/hurt sounds like vanilla sounds?

Started by Hijitori on

Topic category: Help with modding (Java Edition)

Last seen on 18:09, 11. Mar 2022
Joined Jun 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Mob with multiple (random) ambient/hurt sounds like vanilla sounds?

I have 3 sound files in resources:

  • mod.sound.running_z_say1
  • mod.sound.running_z_say2
  • mod.sound.running_z_say3

How can I make mob play randomly 1 of these 3 sounds like vanilla mobs do? (like zombie with "entity.zombie.hurt" = hurt1, hurt2, hurt3 or hurt4).

Are procedures necessary here?

Last seen on 10:10, 15. Mar 2024
Joined Apr 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Yeah procedures would be…
Sun, 08/16/2020 - 12:10

Yeah procedures would be necessary. In the mob element, set the step sound to blank. Then in the triggers section, create a new procedure for 'on entity tick update.' Check if the mob is moving, then set up a randomiser to play either one of the three sounds. Hope this helped :)

Last seen on 10:10, 15. Mar 2024
Joined Apr 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
That's for if your sounds…
Sun, 08/16/2020 - 12:11

That's for if your sounds are step sounds, which I assumed they were due to 'running' in the name. If it's for anything else, you could change the depedencies required to call the procedure

Last seen on 18:09, 11. Mar 2022
Joined Jun 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Hell I  hoped it got changed…
Sun, 08/16/2020 - 13:00

Hell I  hoped it got changed through the year, alright, thanks JJ for help.