RegionJukebox
Is the default Minecraft music a little dull? Would you like to add atmospheric music to your regions? Now you can, with RegionJukebox! Setup your cemeteries with scary organ pipes, or your relaxing vacation home with nice chimes. Just define a region with WorldGuard and then assign either a Minecraft record or a custom resource pack sound to the region. Whenever a player enters the region, the music will play for that player!
Bring in Version 2.0! :D
Holy crap people! I finally did it! Version 2.0 is here! The one feature everyone has been asking for is here now. Drum roll please... Custom music! You can now assign regions to play sounds from resource packs. Just use the same name you use in the sounds.json file in the command. For those that still use the beautiful default Minecraft records, don't worry, you can still use those.
Music. Is. Everywhere. EVERYWHERE! The music now plays at a configurable "speaker" block in the region. If you configure the region to play from a note block, then the music will play from every note block in the region. This way you can have it play from different spots in the region, or even have it play from every grass block (I suggest not doing this, it's pretty intense).
Looping works wonderfully now. Looping is no longer a global setting, and can now be configured per region. The only thing that is needed to loop is the length of the music being played. For custom sounds, you're going to have to guess and check a little bit to get it right. For those using default Minecraft records, you don't even have to worry about it. The plugin already knows the lengths of each record, so you can just leave that argument out of the command.
How to Install:
- WorldGuard IS NEEDED
- WorldGuard Region Events IS NEEDED
- Just drop jar into the plugins folder and you're set!
Current Features:
- Assign music to predefined WorldGuard regions
- Play either Minecraft records or custom resource pack music
- Loop the music! Configurable per region
- Assign a "speaker" block to play the sound at in the region
- Auto-updating
Planned Features:
- Got any suggestions? Go ahead and tell me about them!
Commands:
- /rj help - Shows a list of commands
- /rj recordlist - Shows list of records to play
- /rj regionlist - Shows list of regions with jukebox enabled
- /rj remove - Removes the jukebox from a region
- /rj reload - Reloads configuration file
- /rj set - Sets the region's jukebox music
For additional help with the commands, just type out the command in chat, and their usages along with what each parameter means will be shown.
Permissions:
- regionjukebox.command.rj - Allows the use of the rj command
Source
If you really want the source code, go ahead and decompile the jar file. Really, I don't care. Do what you want!
QA:
Q: Is it possible to make the music play throughout the whole region?
A: Yes! Version 2.0 fixed that! You can configure a "speaker" block to play the sound out of. You then place the designated "speaker" block all around your region.
Q: Can you make the music fade when a player leaves the region?
A: Kind of... Depends on if you're using the default Minecraft records or not. If you're using the records, they stop pretty abruptly. If you're using custom sounds, I actually can't stop those from playing. So as the player walks away from the sound source, it will fade away. If you guys want the records to act the same way as the custom sounds, let me know. I can definitely do that.
Q: Can you add custom music?
A: Yes! Version 2.0 to the rescue again! You can now configure regions to play custom resource pack sounds. Just use the same sound name as the sound.json file.
Q: Can you fix the region within a region thing?
A: I could, but don't want to. That goes beyond the scope of simplicity. That also gets into region detection and that's a lot more complicated.
Another thing that comes up a lot is people telling me the plugin is unresponsive or the events stopped working. I would like to let you know how I handle these. I first see a comment and trying to recreate the problem, load the freshest plugin onto my server. My dev server is always, ALWAYS, running the latest build to keep up with the client. The plugins however, are not, as plugins do not need to run the latest build to stay stable. I then try to recreate the problem using the current available plugin version and the current server. Most of the time, it works. If something doesn't work for you, you can try to delete the plugin and the data folder, and reinstall a fresh copy. If the problem persists, please explain exactly what the problem is and/or a step by step on how to reproduce the problem. Telling me "it doesn't work" doesn't help me at all.
Changelog:
- Version 2.0: *Latest Version*
- You can now play custom music! So excited for this!
- Looping is now configurable on a per region basis
- You can now assign a "speaker" block to play the music out of
- Version 1.6:
- Updated to 1.7.9
- Fixed a bug where leaving a region wouldn't stop the music
- Preparations were made for version 2.0!
- Version 1.52:
- Updated to 1.6.2
- Version 1.51:
- Fixed problem with not being able to remove configured regions
- Version 1.5:
- Rewrote plugin to save regions to config file. No more serialized objects!
- Version 1.45:
- Fixed a metadata error I came across
- Version 1.44:
- Added console log when user doesn't have permission to use command
- Version 1.43:
- Couple minor plugin.yml changes and console spam fixes
- Updated to 1.5.2.
- No changes to functionality
- Version 1.4:
- Regions are saved differently. No longer in unsightly text file. Please delete the text file!
- Version 1.31:
- Updated to 1.5.1
- Version 1.3:
- Added permissions
- Version 1.23:
- Added /rj reload command to reload the configuration file
- Fixed a null issue when leaving a region
- Music replays at the players location every loop cycle
- Version 1.22:
- Fixed console command usage
- Fixed a metadata issue when leaving a region
- Version 1.2:
- Added looping music
- Add configuration toggle for looping music
- Command syntax was slightly changed to accommodate the change in code for looping music
- Version 1.1:
- Fixed bug when updating a region with a new sound
- Added notification to updater so the user knows the plugin is updating itself
- Version 1.0:
- Initial Release
@JeikHardy
Well... I don't have permissions. And I realize that's a big problem. But I do plan to add them. The next update will probably include permissions. Sorry for the delay. I did just update it with looping music however! :D
how I can prevent users from using the commands?
@Unitstorm
That is very unlikely. I don't like the way it stops either, but I'm limited to what Minecraft allows. There's still one way I haven't tried. We'll see though. :p Sorry.
@FunnyGopher
Thanks to try Funny. Yes, I can assume that you're a busy person. Just wanted to tell that your plugin works perfectly when played in smaller regions like a house or a parc but yes, the range is too small for an entire city. :)
Just one more question, do you think you could fade the music when your living the region instead of a cut ?
Thanks ;)
@Unitstorm
I'm trying. Currently, I can't find a way to make the music follow the player; the code I'm using is playing the music at the location the player entered the region. Unless I find a way to make the music follow the player, I'm afraid I can't help you.
I'm still looking though, plus I'm a very busy person, so it might be a while.
Hi Funny ! Awesome plugin you've got here but I have a problem. The music range is not as wide as my worldguard region. I've done a City region but the music can only be heard from a part of the city not all ! Could you help me ?
Thats a cool plugin downloaded it and works super!
When do you think you gonna make the new features?
I miss them :D
Is there any command for setting priorities? I mean when to regions flow
into each other that one region has higher priorities and wont stop playing music.
@lANTHONYl
Spout would be interesting, but at the time being, no. I made this plugin as a custom plugin for a friend, and really had no desire to change it other than to his needs. Sorry.
@Icefang23
That error is not on my end, it's on your end. The error is not being thrown because the plugin is coded wrong. Honestly, I have only seen that error when compiling with a version of java that the code didn't support. I don't know why you'd be getting this error.
Any possibility of adding Spout compatibility? That would allow us to have custom audio, not just normal minecraft music :)
I keep getting this error message
[SEVERE] Could not load 'plugins/RegionJukebox.jar' in folder 'plugins'
org.bukkit.plugin.InvalidPluginException: java.lang.UnsupportedClassVersionError: com/gmail/kyle/huntsman/regionjukebox/RegionJukebox : Unsupported major.minor version 51.0
at org.bukkit.plugin.java.JavaPluginLoader.loadPlugin(JavaPluginLoader.java:184)
at org.bukkit.plugin.SimplePluginManager.loadPlugin(SimplePluginManager.java:305)
at org.bukkit.plugin.SimplePluginManager.loadPlugins(SimplePluginManager.java:230)
at org.bukkit.craftbukkit.v1_4_R1.CraftServer.loadPlugins(CraftServer.java:239)
at org.bukkit.craftbukkit.v1_4_R1.CraftServer.reload(CraftServer.java:594)
at org.bukkit.Bukkit.reload(Bukkit.java:184)
at org.bukkit.command.defaults.ReloadCommand.execute(ReloadCommand.java:23)
at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:186)
at org.bukkit.craftbukkit.v1_4_R1.CraftServer.dispatchCommand(CraftServer.java:514)
at net.minecraft.server.v1_4_R1.PlayerConnection.handleCommand(PlayerConnection.java:980)
at net.minecraft.server.v1_4_R1.PlayerConnection.chat(PlayerConnection.java:898)
at net.minecraft.server.v1_4_R1.PlayerConnection.a(PlayerConnection.java:853)
at net.minecraft.server.v1_4_R1.Packet3Chat.handle(Packet3Chat.java:44)
at net.minecraft.server.v1_4_R1.NetworkManager.b(NetworkManager.java:290)
at net.minecraft.server.v1_4_R1.PlayerConnection.d(PlayerConnection.java:113)
at net.minecraft.server.v1_4_R1.ServerConnection.b(SourceFile:39)
at net.minecraft.server.v1_4_R1.DedicatedServerConnection.b(SourceFile:30)
at net.minecraft.server.v1_4_R1.MinecraftServer.r(MinecraftServer.java:598)
at net.minecraft.server.v1_4_R1.DedicatedServer.r(DedicatedServer.java:224)
at net.minecraft.server.v1_4_R1.MinecraftServer.q(MinecraftServer.java:494)
at net.minecraft.server.v1_4_R1.MinecraftServer.run(MinecraftServer.java:427)
at net.minecraft.server.v1_4_R1.ThreadServerApplication.run(SourceFile:849)
Caused by: java.lang.UnsupportedClassVersionError: com/gmail/kyle/huntsman/regionjukebox/RegionJukebox : Unsupported major.minor version 51.0
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClassCond(ClassLoader.java:631)
at java.lang.ClassLoader.defineClass(ClassLoader.java:615)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:283)
at java.net.URLClassLoader.access$000(URLClassLoader.java:58)
at java.net.URLClassLoader$1.run(URLClassLoader.java:197)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at org.bukkit.plugin.java.PluginClassLoader.findClass0(PluginClassLoader.java:80)
at org.bukkit.plugin.java.PluginClassLoader.findClass(PluginClassLoader.java:53)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:247)
at org.bukkit.plugin.java.JavaPluginLoader.loadPlugin(JavaPluginLoader.java:173)
... 21 more
@zacass
I am trying to fix both those issues. Right now the way it works, it plays the music where you enter the region. So the music plays from a fixed location, and therefore the lower volume at father distances. I have tried to solve this and it looks kinda impossible to implement nicely. The second is a little more possible, I just need to look further into it. I am working on it however.
@FunnyGopher When I set the music to a large region and walk far away from the area where the music starts it keeps getting lower and lower in sound until you can't hear it - like a normal jukebox- is there anyway around this? also the music does not loop.. great plugin minus those issues :P
Awesome, I was wondering if there was a plugin that did this, and I just found it!
@jitasi
Are you sure you were using the correct ID number of a disc?
Hi, after I add the disc to the region, no music plays, re-logging dosnt work nor does leaving and reentering the region or executing a server reload, any help please?
@Linkeric
I'll keep it up to date as much as I can. Not much should change though, but it relies on WGRegionEvents and WorldGuard and I'm not in control of their updates. But I'll try my hardest! :)
Oooooooh yeah.. I was looking for a plugin like this, ans i found it ! Will you keep it up to date ? I hope you will ! Thrank youuuuuuu !!!
This sounds cool... if you know what i mean...
@Nickbbeezy
Midi support sounds interesting. I'll look into it. :)