Posted April 25, 20205 yr I'm having problems with playing my custom SoundEvents, I've tried every version of the playSound method and tried using world.isRemote, but it still won't play. The sound is valid, the sounds.json is valid and the sound plays fine when using the playsound command ingame, what am I missing here? It's sad how much time mods spend saying "x is no longer supported on this forum. Please update to a modern version of Minecraft to receive support".
April 25, 20205 yr Author Just now, diesieben07 said: Show your code. this.world.playSound(this.getMaster(), new BlockPos(this.getMaster().getPosX(), this.getMaster().getPosY(), this.getMaster().getPosZ()), this.getSpawnSound(), this.getSoundCategory(), 1.0f, 1.0f); getMaster returns the player, it works fine so it's not the issue, getSpawnSound returns the custom SoundEvent. It's sad how much time mods spend saying "x is no longer supported on this forum. Please update to a modern version of Minecraft to receive support".
April 25, 20205 yr Author 24 minutes ago, diesieben07 said: The way you are using this method (with a non-null player) you must call it on both client and server, with the same player. Whats the best way to do this? DistExecutor, OnlyIn or World#isRemote? It's sad how much time mods spend saying "x is no longer supported on this forum. Please update to a modern version of Minecraft to receive support".
April 25, 20205 yr Author 1 minute ago, diesieben07 said: I have no idea where you are trying to play this sound from. From a packet. It's sad how much time mods spend saying "x is no longer supported on this forum. Please update to a modern version of Minecraft to receive support".
April 25, 20205 yr Author On 4/25/2020 at 6:48 PM, diesieben07 said: Server to client? Client to server? When is this packet sent? Can you please just explain the details so we don't have to go around in circles for 20 posts? Thank you. Here's the class on GitHub: https://github.com/Novarch129/JoJo-s-Blocky-Adventure/blob/9cd711da2a15ab17ffcb085798f211284f3fbf3f/src/main/java/com/novarch/jojomod/network/message/SyncStandSummonButton.java. It's syncing a KeyBind to the server, so it's client to server. Edited July 3, 20205 yr by Novârch It's sad how much time mods spend saying "x is no longer supported on this forum. Please update to a modern version of Minecraft to receive support".
April 25, 20205 yr Author 39 minutes ago, diesieben07 said: Then you must pass null as the player for it to play it to all players in range. Still not working, exact code is: this.world.playSound(null, new BlockPos(this.getMaster().getPosX(), this.getMaster().getPosY(), this.getMaster().getPosZ()), this.getSpawnSound(), this.getSoundCategory(), 1.0f, 1.0f) It's sad how much time mods spend saying "x is no longer supported on this forum. Please update to a modern version of Minecraft to receive support".
April 26, 20205 yr Author 9 hours ago, diesieben07 said: Is the method called? It is, all the code in the message works. It's sad how much time mods spend saying "x is no longer supported on this forum. Please update to a modern version of Minecraft to receive support".
April 26, 20205 yr Author Still haven't fixed this, the code used to work perfectly back in 1.12, has something about the method changed? *Edit: For some reason switching to deferred registers made it work. Edited April 26, 20205 yr by Novârch It's sad how much time mods spend saying "x is no longer supported on this forum. Please update to a modern version of Minecraft to receive support".
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.