Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

Posted

Hi there!

I finally able to set up a moving sound effect that follows the player and stops when i want it.

But it can be only heard by the player who created the sound.

How can i make my sound for others to hear it? Sounds are played in a CLIENT tick handler right now.

Thanks!

If you can, play the sound on the server directly via worldObj.playSoundAtEntity or worldObj.playSoundEffect (both of which will automatically play the sound for nearby clients, though I haven't looked into the exact mechanics going on under the hood); otherwise, you need to send your sound in a packet to the server and from there re-broadcast the packet to nearby players.

  • Author

I can't use them because they play the sound at a given pos.

My sounds follows the player.

I have looked up how minecart does it but i cant find the method where its playing its sounds.

 

  • Author

The sounds plays from the player when he holds down the right mouse button if an item is held.

I want to use onUpdate() but i cant play client sounds on it what is understandable.

I don't want to play the sound every time and my sounds its already working based on the MovingSoundsMinecart.

Except the sound is connected to the player.

I playing my sounds with Minecraft.getMinecraft().getSoundHandler.playSound(sound) tight now client side.

I can't realy know other ways to do it, but others cant hear the sounds.

With pakets it can cause lag? I it nessecaryt to use them?

Thanks.

  • Author

Everything is based on the MovingSoundMinecart except i changed TileEntity to EntityPlayer.

Here is my code so you can understand it:

http://pastebin.com/Paxp1jfz

 

Its not a problem, this is how i want it to work.

The problem is others can't hear that sounds.

 

I playing sounds like so:

ISound start = new PatronusSoundEvent("patronus:PatronusStart", mc.thePlayer, 1.0F, 1.0F);

Minecraft.getMinecraft().getSoundHandler().playSound(start);

  • Author

I just left it there by accident.

The packet sending did the trick so thank you diesieben.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.