Solved How to play record to someone?

Discussion in 'Plugin Development' started by MgMaor, Aug 15, 2013.

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

    MgMaor

    How can I play "mellohi" for someone for example?

    I tried to do:

    Jukebox jb = new Jukebox(); //<- Error: Cannot instantiate the type Jukebox
    jb.setPlaying(Material.RECORD_11);
     
  2. Offline

    RealDope

  3. Offline

    MgMaor

    How to play someone jukebox music?
     
  4. Offline

    RealDope

    Oh you mean play jukebox music for only one person?
     
  5. Offline

    MgMaor

    yes
     
  6. Offline

    hubeb

    player.playsound?
     
  7. Offline

    MgMaor

    no.
     
  8. If your trying to play a sound for just one player:
     
  9. Offline

    MgMaor

    no.
    jukebox music, not sound.

    help?

    someone here?

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

    Quantix

    EDIT: Never mind, I thought you wanted to play a note block sound, the code to play a jukebox record is below
     
  11. Offline

    MgMaor

    Jukebox not noteblock/sound.
     
  12. Offline

    Quantix

    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)
     
    GrandmaJam likes this.
  13. Offline

    MgMaor

    Thx dude!
    :D
     
  14. Offline

    Door Knob

    wtf, people told me that wasnt possible!! Haha, learn new things every day.
     
    GrandmaJam likes this.
Thread Status:
Not open for further replies.

Share This Page