Bug? Calling "play sound" not playing the sound

Started by ahznb on Fri, 12/06/2019 - 11:18

Topic category: Help with modding

Last seen on 21:33, 26. Jan 2020
Joined Nov 2019
User points:

Statistics:

  • Comments:
  • Forum topics:
  • Modifications:
  • Wiki pages:
  • Tracker tickets:
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
0Upvote this forum topic
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.

0Upvote this forum topic
Last seen on 21:33, 26. Jan 2020
Joined Nov 2019
User points:

Statistics:

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

Its from Custom block element, Random tick event.

0Upvote this forum topic
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.

1Upvote this forum topic
Last seen on 21:33, 26. Jan 2020
Joined Nov 2019
User points:

Statistics:

  • Comments:
  • Forum topics:
  • Modifications:
  • Wiki pages:
  • Tracker tickets:
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?

0Upvote this forum topic
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.

0Upvote this forum topic
Last seen on 21:33, 26. Jan 2020
Joined Nov 2019
User points:

Statistics:

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

Thanks for the explanation!

0Upvote this forum topic