How to play Records (music)

Discussion in 'Plugin Development' started by Desle, Oct 24, 2013.

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

    Desle

    Hi there,

    I've come across an issue.. where i don't know how to play music discs, the way you can play sounds with the getPlayer().playSound()..

    How do i play music discs?
     
  2. Offline

    Foorack

    Desle, To play the sound of a jukebox record use:
    Code:java
    1. player.playEffect(player.getLocation(), Effect.RECORD_PLAY, Material.RECORD_3.getId());
    2. //To play any of the 12 records found in Minecraft use their material ID's
    3. //Use Material.GREEN_RECORD.getId(), Material.GOLD_RECORD.getId() or Material.RECORD_(# between 3 and 12).getId()

    You can also stop the playing of a record by doing the same thing as above but setting the ID to 0
    (Please mark the thread as solved if this worked) :p
     
    Desle and sgavster like this.
  3. Offline

    sgavster

    Foorack this isn't my thread but.. THANK YOU xD
     
  4. Offline

    Desle


    Thanks a bunch.
    Is it possible to only play it for a certain player, and follow it coordinates?
     
  5. Offline

    Quantix

    Huh, something tells me I've seen this post before... ;)
     
Thread Status:
Not open for further replies.

Share This Page