Jump to content

MrBlob

Members
  • Posts

    2
  • Joined

  • Last visited

MrBlob's Achievements

Tree Puncher

Tree Puncher (2/8)

0

Reputation

  1. This was my first suspicion, so I tried testing with a client side event: @SubscribeEvent public void onBreak(ClientChatReceivedEvent event) { Minecraft.getMinecraft().thePlayer.playSound("minecraft:block.anvil.hit", 1.0f, 1.0f); } Still, I got nothing. I have no clue what I'm doing wrong. Additionally, If I refer to that documentation and try and play the sound from the world like this: @SubscribeEvent public void onBreak(BreakEvent event) { if (event.state.getBlock() == Blocks.pumpkin) { event.world.playSound(event.getPlayer().getPosition().getX(), event.getPlayer().getPosition().getY(), event.getPlayer().getPosition().getZ(), "minecraft:block.anvil.hit", 1.0f, 1.0f, true); } } or like this @SubscribeEvent public void onBreak(BreakEvent event) { if (event.state.getBlock() == Blocks.pumpkin) { event.world.playSoundEffect(event.getPlayer().getPosition().getX(), event.getPlayer().getPosition().getY(), event.getPlayer().getPosition().getZ(), "minecraft:block.anvil.hit", 1.0f, 1.0f); } } I get nothing
  2. @SubscribeEvent public void onBreak(BreakEvent event) { if (event.state.getBlock() == Blocks.pumpkin){ event.getPlayer().playSound("minecraft:block.anvil.hit", 1.0f, 1.0f); } } The event is working fine, but the sound isn't playing. Any help is greatly appreciated!
×
×
  • Create New...

Important Information

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