Create block place sound?

Discussion in 'Plugin Development' started by Kepler_, Jun 27, 2013.

Thread Status:
Not open for further replies.
  1. Offline


    Right now i'm using this to create a sound:
    World.playEffect(block.getLocation(), Effect.STEP_SOUND, block.getTypeId());

    This does create the sound of the block being placed, but it also has a particle effect of the block being broken. How can I create the sound of a block being placed without having the particle effects?

  2. Offline


    call playSound instead of playEffect
    Faith likes this.
  3. Offline


    What sound would I use to make a block place sound for any block?

    Anyone know how to do this?

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
    Last edited by a moderator: Jun 2, 2016
  4. Offline


  5. Offline


    I'm a bit confused by that. Which step sound would I use for something that isn't on the list, like obsidian for example? The only way I can see to do this is to create a switch statement with all of the materials to determine which step sound to use.
  6. Offline


    To figure out what it is try placing it in game and yeah you probably would have to do a switch statement or an enum or you could cast the block to a craftblock and then get handle and get the NMS material (I think...) and do a switch statement on that to get the sound from that.
Thread Status:
Not open for further replies.

Share This Page