Bug? Calling "play sound" not playing the sound

Started by ahznb on

Topic category: Help with modding (Java Edition)

Last seen on 05:29, 31. Jan 2022
Joined Nov 2019
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Bug? Calling "play sound" not playing the sound
Sat, 12/07/2019 - 15:22 (edited)

I'm trying to call playSound inside my custom block's randomTickUpdateEvent like this:

screen cap of my proc

But the sound doesn't play at all. The line after it that sends chat will display the text though.

Is this a bug? Sounds play when called from other procs, so is it because it was called inside a tick event?

Edited by ahznb on Sat, 12/07/2019 - 15:22
Tick event of which mod…
Fri, 12/06/2019 - 17:27

Tick event of which mod element? You can open a support ticket and upload your workspace and tell me which mod elements to check too.

Last seen on 05:29, 31. Jan 2022
Joined Nov 2019
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Its from Custom block…
Sat, 12/07/2019 - 00:56

Its from Custom block element, Random tick event.

Random tick event has a…
Sat, 12/07/2019 - 09:13

Random tick event has a computer icon next to it which means it is a client-only event and should only be used for particle effects.

Use tick update for this instead.

Last seen on 05:29, 31. Jan 2022
Joined Nov 2019
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Ah, tick update works. But…
Sat, 12/07/2019 - 09:41

Ah, tick update works.

But looking in vanilla minecraft code in net.minecraft.block.BlockFire, they call playSound in randomDisplayTick, which is client side only as well. How is that?

There are a few different…
Sat, 12/07/2019 - 10:00

There are a few different implementations of play sound and some are client-side only and this one is used by say a fire.

To offer better support for multiplayer and not to confuse users, we only offer server-side play sound procedure block.

Last seen on 05:29, 31. Jan 2022
Joined Nov 2019
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Thanks for the explanation!
Sat, 12/07/2019 - 10:26

Thanks for the explanation!