How to play music while you're in water for some time

Started by RedCorr on

Topic category: Help with modding (Java Edition)

Last seen on 16:59, 27. Aug 2022
Joined Sep 2019
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
How to play music while you're in water for some time

Hello! Recently was interested in making a client-sided mod that allows you to play specific music if you're in water for a long period of time.
Can I actually make that? If so, what code do i need to write?

Last seen on 04:08, 14. Dec 2022
Joined May 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
You could probably use the…
Sun, 07/10/2022 - 00:26

You could probably use the world trigger on player tick update to start playing the music randomly. Just be careful when using Tick Update world triggers as they can cause performance issues if the procedure is too big.