Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

Custom Sounds not playing on server


Ron_Parker
 Share

Recommended Posts

I am using the playSound function with a custom sound and it's works with no problems in a singleplayer world but whenever I try to play it on a multiplayer world the sound doesn't play. It is executing just fine because I put a logger there but it just isn't playing the sound. If anyone has any ideas or a solution please let me know! Thanks!

Edited by Ron_Parker
Link to comment
Share on other sites

  • Do not use @OnlyIn.
  • You are reaching across logical sides: Your onItemRightClick is called on logical server and logical client - yet it accesses client-only code. You cannot check key bindings like this. You will need to use ClientTickEvent to check if a key binding is pressed, if so play the sound and also send a custom packet to the server, so that the server can play the sound for other players.
Link to comment
Share on other sites

Ok, I think I fixed the Keybinds but i'm a little lost on the packet sending. I took a shot at it but I don't know what to pass in for player? Is there a library file that would show something like this in action? 'Cause I was thinking of how a potion bottle sound plays to the player and all players around, that's kinda what i'm trying to do. I updated the Git repository if you would like to take a look.

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.

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

 Share



×
×
  • Create New...

Important Information

By using this site, you agree to our Privacy Policy.