Jump to content

[1.7.10]Moving sound effect


FLUFFY2

Recommended Posts

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!

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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);

Link to comment
Share on other sites

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...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

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