NoteBlockAPI
NoteBlockAPI
NoteBlockAPI - play .nbs files as noteblock sounds
Play your favorite songs ingame!
Features
- play .nbs files ingame as noteblock sounds
- easy to use
- uses multi threading
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
Bamradio: 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
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/2:
add this line to your plugin.yml:
depend: [NoteBlockAPI]
Step 1:
Parse a .nbs file
Song s = NBSDecoder.parse(new File(getDataFolder(), "Song.nbs")); or Song s = NBSDecoder.parse(new File("/plugins/myplugin/Song.nbs"));
Step 2:
Create a player for the song
SongPlayer sp = new RadioSongPlayer(s);
Step 3:
define if the song should end when no one listens to it
sp.setAutoDestroy(true);
Step 4:
Add players to Song
sp.addPlayer(e.getPlayer());
Step 5:
Play song
sp.setPlaying(true);
GitHub
Contribute now and help us to update and improve NoteBlockAPI!
https:github.com/xxmicloxx/NoteBlockAPI
Hi! :)
Is there any way to tell when a song has ended so a new one may be auto-started?
Cheers!
@Hi5TBone
It's related to NoteBlockJoin plugin, as you can see here:
[Server thread/ERROR]: Could not pass event PlayerJoinEvent to NoteblockJoin v1.0
I get this Error when trying to run A plugin (NoteBlockJoin) that uses NoteBlockAPI
[18:44:39] [Server thread/INFO]: Hi5TBone[/*.*.*.*:**] logged in with entity id 2833 at ([world] 852.4072578877634, 4.063459361424469, 34.66489404160701) [18:44:39] [Server thread/ERROR]: Could not pass event PlayerJoinEvent to NoteblockJoin v1.0 org.bukkit.event.EventException at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:294) [bukkit-dev-1.7.2-R0.4-build-3023.jar:git-Bukkit-1.7.2-R0.3-2-g85f5776-b3023jnks] at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:62) [bukkit-dev-1.7.2-R0.4-build-3023.jar:git-Bukkit-1.7.2-R0.3-2-g85f5776-b3023jnks] at org.bukkit.plugin.SimplePluginManager.fireEvent(SimplePluginManager.java:501) [bukkit-dev-1.7.2-R0.4-build-3023.jar:git-Bukkit-1.7.2-R0.3-2-g85f5776-b3023jnks] at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:486) [bukkit-dev-1.7.2-R0.4-build-3023.jar:git-Bukkit-1.7.2-R0.3-2-g85f5776-b3023jnks] at net.minecraft.server.v1_7_R1.PlayerList.c(PlayerList.java:225) [bukkit-dev-1.7.2-R0.4-build-3023.jar:git-Bukkit-1.7.2-R0.3-2-g85f5776-b3023jnks] at net.minecraft.server.v1_7_R1.PlayerList.a(PlayerList.java:116) [bukkit-dev-1.7.2-R0.4-build-3023.jar:git-Bukkit-1.7.2-R0.3-2-g85f5776-b3023jnks] at net.minecraft.server.v1_7_R1.LoginListener.c(LoginListener.java:78) [bukkit-dev-1.7.2-R0.4-build-3023.jar:git-Bukkit-1.7.2-R0.3-2-g85f5776-b3023jnks] at net.minecraft.server.v1_7_R1.LoginListener.a(LoginListener.java:42) [bukkit-dev-1.7.2-R0.4-build-3023.jar:git-Bukkit-1.7.2-R0.3-2-g85f5776-b3023jnks] at net.minecraft.server.v1_7_R1.NetworkManager.a(NetworkManager.java:149) [bukkit-dev-1.7.2-R0.4-build-3023.jar:git-Bukkit-1.7.2-R0.3-2-g85f5776-b3023jnks] at net.minecraft.server.v1_7_R1.ServerConnection.c(SourceFile:134) [bukkit-dev-1.7.2-R0.4-build-3023.jar:git-Bukkit-1.7.2-R0.3-2-g85f5776-b3023jnks] at net.minecraft.server.v1_7_R1.MinecraftServer.u(MinecraftServer.java:655) [bukkit-dev-1.7.2-R0.4-build-3023.jar:git-Bukkit-1.7.2-R0.3-2-g85f5776-b3023jnks] at net.minecraft.server.v1_7_R1.DedicatedServer.u(DedicatedServer.java:250) [bukkit-dev-1.7.2-R0.4-build-3023.jar:git-Bukkit-1.7.2-R0.3-2-g85f5776-b3023jnks] at net.minecraft.server.v1_7_R1.MinecraftServer.t(MinecraftServer.java:545) [bukkit-dev-1.7.2-R0.4-build-3023.jar:git-Bukkit-1.7.2-R0.3-2-g85f5776-b3023jnks] at net.minecraft.server.v1_7_R1.MinecraftServer.run(MinecraftServer.java:457) [bukkit-dev-1.7.2-R0.4-build-3023.jar:git-Bukkit-1.7.2-R0.3-2-g85f5776-b3023jnks] at net.minecraft.server.v1_7_R1.ThreadServerApplication.run(SourceFile:617) [bukkit-dev-1.7.2-R0.4-build-3023.jar:git-Bukkit-1.7.2-R0.3-2-g85f5776-b3023jnks] Caused by: java.lang.NoSuchMethodError: com.xxmicloxx.NoteBlockAPI.Song.setAutoDestroy(Z)V at de.cooki3lp.noteblock.PlayerJoin.onPlayerJoin(PlayerJoin.java:27) [?:?] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [?:1.7.0_51] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) [?:1.7.0_51] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) [?:1.7.0_51] at java.lang.reflect.Method.invoke(Method.java:606) [?:1.7.0_51] at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:292) [bukkit-dev-1.7.2-R0.4-build-3023.jar:git-Bukkit-1.7.2-R0.3-2-g85f5776-b3023jnks] ... 14 more
I dunno if It has something to do with NoteBlockJoin or NoteBlockAPI
@Patfreeze
The plugin BAMradio does not support the latest version of the NoteBlockAPI, i will rewrite the implementation in the next days tho.
How do I make it so it only plays for the a certain player?
@Elementronix Hi! Try to put the code in the file bukkit.yml The API is detected for me, but I use BAMRadio and now, the BAMRadio plugin does'nt dectect NoteBlock... Maybe for you it will work.
I'm also not finding Plugin.yml
Maybe I'm stupid but I don't find the file plugin.yml The plugin is not detected by bukkit. Maybe I have the wrong version of bukkit (version 1.7.2-R0.3)
By me, the plugin always disabled. What I do wrong?
I love it!
Will the new version work with 1.5.2?
Doesn't work...some one help?
I did script on VarScript with this API.
This script allow play .nbs from url on jukebox ^_^.
Video
Since the new version of NoteBlockApi doesnt work just download the 1.0,1 NoteBlockApi that will work
@raznet777
I just get this error message when i do any command :(
[16:57:42 ERROR]: null org.bukkit.command.CommandException: Unhandled exception executing command 'play all' in plugin NoteBlockPlayer v1.1.2 at org.bukkit.command.PluginCommand.execute(PluginCommand.java:46) [cra ftbukkit.jar:git-Bukkit-1.7.2-R0.2-3-g530fcb7-b2982jnks] at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:19 6) [craftbukkit.jar:git-Bukkit-1.7.2-R0.2-3-g530fcb7-b2982jnks] at org.bukkit.craftbukkit.v1_7_R1.CraftServer.dispatchCommand(CraftServe r.java:542) [craftbukkit.jar:git-Bukkit-1.7.2-R0.2-3-g530fcb7-b2982jnks] at net.minecraft.server.v1_7_R1.PlayerConnection.handleCommand(PlayerCon nection.java:932) [craftbukkit.jar:git-Bukkit-1.7.2-R0.2-3-g530fcb7-b2982jnks] at net.minecraft.server.v1_7_R1.PlayerConnection.a(PlayerConnection.java :814) [craftbukkit.jar:git-Bukkit-1.7.2-R0.2-3-g530fcb7-b2982jnks] at net.minecraft.server.v1_7_R1.PacketPlayInChat.a(PacketPlayInChat.java :28) [craftbukkit.jar:git-Bukkit-1.7.2-R0.2-3-g530fcb7-b2982jnks] at net.minecraft.server.v1_7_R1.PacketPlayInChat.handle(PacketPlayInChat .java:47) [craftbukkit.jar:git-Bukkit-1.7.2-R0.2-3-g530fcb7-b2982jnks] at net.minecraft.server.v1_7_R1.NetworkManager.a(NetworkManager.java:146 ) [craftbukkit.jar:git-Bukkit-1.7.2-R0.2-3-g530fcb7-b2982jnks] at net.minecraft.server.v1_7_R1.ServerConnection.c(SourceFile:134) [craf tbukkit.jar:git-Bukkit-1.7.2-R0.2-3-g530fcb7-b2982jnks] at net.minecraft.server.v1_7_R1.MinecraftServer.u(MinecraftServer.java:6 55) [craftbukkit.jar:git-Bukkit-1.7.2-R0.2-3-g530fcb7-b2982jnks] at net.minecraft.server.v1_7_R1.DedicatedServer.u(DedicatedServer.java:2 50) [craftbukkit.jar:git-Bukkit-1.7.2-R0.2-3-g530fcb7-b2982jnks] at net.minecraft.server.v1_7_R1.MinecraftServer.t(MinecraftServer.java:5 45) [craftbukkit.jar:git-Bukkit-1.7.2-R0.2-3-g530fcb7-b2982jnks] at net.minecraft.server.v1_7_R1.MinecraftServer.run(MinecraftServer.java :457) [craftbukkit.jar:git-Bukkit-1.7.2-R0.2-3-g530fcb7-b2982jnks] at net.minecraft.server.v1_7_R1.ThreadServerApplication.run(SourceFile:6 17) [craftbukkit.jar:git-Bukkit-1.7.2-R0.2-3-g530fcb7-b2982jnks] Caused by: java.lang.ArrayIndexOutOfBoundsException: 2 at de.michidk.NoteBlockPlayer.Main.onCommand(Main.java:108) [?:?] at org.bukkit.command.PluginCommand.execute(PluginCommand.java:44) [cra ftbukkit.jar:git-Bukkit-1.7.2-R0.2-3-g530fcb7-b2982jnks] ... 13 more
And yes, i have both :O
@ZenTauren
Have you downloaded Noteblockplayer AND Noteblock API?
It doesn't even work for 1.7.2 :(
I have a problem. I am making a plugin with your API but I can't use s.setSelfDestroy(true); Eclipse says, that the method is undefined for type song. This is my fist plugin so don't know very much about making plugins. I hope you can help me :)
Javadocs and/or source please.
Er, I don't get both helps. How do we parse a .nbs file, and where do we put all this text?