How to make a sound(music) follows an entity

Started by Megidora on

Topic category: Help with Minecraft modding (Java Edition)

Joined Jan 2024
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
How to make a sound(music) follows an entity

So, I made that an entity play a music when you right click it, the entity is rideable(which mean that usually it moves alot), but unlike the entity the sound stay in one place which is bad. I tried increasing the level but it is not solving the problem because the sound source is still in one place but we can just hear it from far distance, thanks for help

Joined May 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Unfortunately this is a side…
Wed, 01/17/2024 - 13:33

Unfortunately this is a side effect of how Minecraft's sound effects work, it's not designed to change the position of a sound once the sound starts playing. The only solution I can really recommend is dividing your music up into smaller segments that can be rearranged together, and playing one of these at the entity's location every couple seconds or so.

Joined Jan 2024
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
well, I have this idea in…
Wed, 01/17/2024 - 18:09

well, I have this idea in mind, but I thought that there will be easier way for this, but thank you anyway

Joined Nov 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
make the check on…
Wed, 01/17/2024 - 23:43

make the check on PlayerUpdateTick:

-If Entity is Riding Entity X (your rideable mob)

 then play sound Y (your song)

Joined Nov 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
ops nvm you want the music…
Wed, 01/17/2024 - 23:47

ops nvm you want the music to follow you, bummer thats a tuff one

Joined Mar 2019
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
use the playsound command on…
Thu, 01/18/2024 - 01:25

use the playsound command on the riding entity, learn about it in the wiki and apply it to the entity that is riding the mob