NoteBlockAPI 1.2.2.1(MC1.8+)

Play .nbs files as noteblock sounds

  1. koca2000
    Tested Minecraft Versions:
    • 1.8
    • 1.9
    • 1.10
    • 1.11
    • 1.12
    • 1.13
    Contributors:
    xxmicloxx

    Play your favorite songs ingame!

    Do you want official player? Then use this: NoteBlockMusicPlayer

    Dev builds for 1.13 available here

    Original thread (1.8 and less)


    Features
    • play .nbs files ingame as noteblock sounds
    • easy to use
    • uses multi threading
    • can play custom instruments via resource pack and pling
    Plugins that use NoteBlockAPI
    NoteBlockPlayer: play for certain or all players .nbs files
    Pl3xPager: get your attention by playing .nbs files
    McMusic: play .nbs files
    ServerMusic: play .nbs files with signs
    icJukeBox: song selector with a fancy chest-gui
    Dubstep Gun: use the power of Dupstep
    JoinMusik: play a .nbs file for players that join your server
    JukeBox
    ♪ Noteblock Worldguard ♪

    ColorfulMix - music in lobby and arena

    Instruments from 1.12 on 1.8 - 1.11 servers
    By default they are simply skipped. You can enable them by using resource pack.

    How to get .nbs
    Download .nbs files
    You can simply download a few songs here:
    .nbs list or scroll down for another list

    Convert .midi to .nbs
    use Minecraft Note Block Studio:
    http://www.stuffbydavid.com/mcnbs
    1. import your .midi file to Note Block Studio;
    2. save the file as .nbs file in your plugin folder

    How to use (since version 1.1.0)
    Step 1:
    If you use Maven, add this to your pom.xml(for last version):
    Code (Text):
        <repositories>
            <repository>
                <id>jitpack.io</id>
                <url>https://jitpack.io</url>
            </repository>
        </repositories>

        <dependency>
            <groupId>com.github.koca2000</groupId>
            <artifactId>NoteBlockAPI</artifactId>
            <version>-SNAPSHOT</version>
        </dependency>
    or add jar to your project dependencies.

    Step 2:
    add this line to your plugin.yml:
    Code (Text):
    depend: [NoteBlockAPI]
    Step 3:
    Parse a .nbs file
    Code (Text):
    Song s = NBSDecoder.parse(new File(getDataFolder(), "Song.nbs"));
    or
    Code (Text):
    Song s = NBSDecoder.parse(new File("/plugins/myplugin/Song.nbs"));
    Step 4:
    Create a player for the song
    Code (Text):
    SongPlayer sp = new RadioSongPlayer(s);
    Step 5:
    define if the song should end when no one listens to it
    Code (Text):
    sp.setAutoDestroy(true);
    Step 6:
    Add players to Song
    Code (Text):
    sp.addPlayer(e.getPlayer());
    Step 7:
    Play song
    Code (Text):
    sp.setPlaying(true);

    GitHub (new)
    https://github.com/koca2000/NoteBlockAPI


    GitHub (original)
    https:github.com/xxmicloxx/NoteBlockAPI

Recent Updates

  1. v1.2.2.1
  2. v1.2.2
  3. v1.2.1 - Minecraft 1.13 update, structure changes

Recent Reviews

  1. ZockerAxel
    ZockerAxel
    5/5,
    Version: 1.2.2.1(MC1.8+)
    Really great Resource if you want Music on your server and features a great API to use in your Plugins!
  2. SkytAsul
    SkytAsul
    5/5,
    Version: 1.2.1(MC1.8+)
    Great update here ! Nice to see that the code is more clean now ^^
    Keep up like this !!
  3. StupidDrew9
    StupidDrew9
    5/5,
    Version: 1.2.0(MC1.8+)
    Great API, fairly straightforward and easy to use. Has all the methods that I needed. Could use more documentation (took me a while to figure out what the layerHashMap was in the Song class, etc)
    1. koca2000
      Author's Response
      I am working on Github wiki and javadoc.
  4. ItzzSebasGamer
    ItzzSebasGamer
    5/5,
    Version: 1.2.0(MC1.8+)
    API usage?
    -----------------------------------------------------------------------------------------------------------------
  5. _Avery
    _Avery
    5/5,
    Version: 1.2.0(MC1.8+)
    This is a very nice and useful API. But can i ask if a song is over, because i want display the title of the song and thats the reason why i need a method.
    1. koca2000
      Author's Response
      You can use SongEndEvent. If you need more info, please use PM.
  6. File14
    File14
    5/5,
    Version: 1.2.0(MC1.8+)
    Working great. The developer of this plugin responds fast. Thank you for making this plugin!
  7. Sprax2013
    Sprax2013
    5/5,
    Version: 1.1.9(MC1.8+)
    Works great! Reported an issue on GitHub and it was fixed really quick!
    Nice Dev. Nice API. Helped me a lot :)
  8. Cloth
    Cloth
    5/5,
    Version: 1.1.9(MC1.8+)
    Perfect, works exactly as described. Also provides frequent updates to fix bugs, add new features, etc.
  9. Msql
    Msql
    3/5,
    Version: 1.1.7(MC1.8+)
    I do not know, but when I play any song from NoteBlockStudio, this API is spamming my console with error every note.
    Error:
    https://pastebin.com/utTuZfv9
    1. koca2000
      Author's Response
      Please don't use reviews as issue tracker. Write me pm or create issue on github and I'll do my best to solve your problem.
  10. maxw2000
    maxw2000
    5/5,
    Version: 1.1.7(MC1.8+)