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
@bestlike2
Plugin will be updated once Bukkit releases a stable build of 1.5.
Please updat.e
Man.. it dosnt work with 1.5 :( lol.
I can't wait till it does.
Will this plugin have any effect on performance of the server?
As far as custom music, i can't remember the plugin, gut it played custom music from an external web link. So I could, add the music files to my web server and play them from there.
@Unitstorm
1. Totally possible. Sounds like a good idea, I wouldn't use it, but easily implementable.
2. Lots harder. Actually, I just lied. I don't have the knowledge of back-end region detecting, and where regions lie in relation to one another. So because of said knowledge, or lack there of, it's harder. With the little amount I looked into when making the plugin, it looks pretty chunky code wise. I'll look into it, but don't expect it.
I tend to like simple. If you look at my other plugins, they are relatively simple plugins. I'm not into making huge, complicated plugins. Big plugins are the reason I make simple plugins, because there's too many features in big plugins and I only want one feature out of twenty, so I make my own. Plus, I find simple easy to implement on servers, and they tend to be more fun because of the ease of use. Not trying to totally reject your idea or anything, it sounds great and I would love to have it implemented, I'm just explaining my rationale for rejecting some of the more in depth features people are asking for.
Hi funny, I re-tested your plugin, it's a lot better. The loop effect is really helpful but I've got suggestions for you.
1 : Could you add an option that can make us change the moment of the music when it loops = to make it loop before finishing the song
2 : The most important one, could you implement an option that makes the music launch when you leave a sub-region to go in a biggest region : let me explain. I draw a region around a building inside my town. The town region is a parent of the building region. I want a special music inside that building, but when I leave it, I want the music of my town to play again.
Sorry for my bad English :/
@Mcphiction
I chose to ignore you the first time you posted this. No, I'm not going to add custom music. That would require spout. I'm not coding for spout.
@Kino876
Hmmm, never had this problem, so I have no idea what could be the problem. If your regions are within each other, that might be causing it. Other than that, no idea.
EDIT: Plus, I've never tested this with multiple worlds, sooooo...
Hi,
In my case I have a problem, every time I set up a region, it ignores the area and sounds everywhere, even in all the worlds.
I have about 20 WorldGuard regions and WorldGuard Region Events installed.
I checked all regions with /region select idname and everything is correct.
@artlune
I understand you now. Just leave the music in the region and walk away from it so it fades. Currently, that's not how it works. It might be possible with looping music. I'd have to look into it. Without looping music, completely possible.
@FunnyGopher
It says the looped sound is played at the current location of the player. I was suggesting having it detect where that is and pretend there is a jukebox there. The further away you are from that point, the lower the sound gets until it "fades". If you leave a region it just ends.
Sorry I lack an understanding of how it works. Is that not possible?
@artlune
Music can't fade. Looping a "playlist", I can try.
Can the music fade when exiting the region fade instead of ending abruptly? Similar to how far away you are from a jukebox but from the point the music started.
Could we also loop multiple discs that play randomly one after another? Some songs sound similar and would go well together. Just some thoughts.
@artlune
Yeah, I figured out later there would be a problem with the way it stopped the music and the looping if there were 2 regions really close or inside one another. I'm figuring out a way to fix it.
@FunnyGopher
I think I just had the same error as McBirdCraft.
http://pastebin.com/LeQWS9d0
Edit: It keeps happening when I change regions too quickly. I had 2 regions beside each other each with a different jukebox set to play. If I walk from one to the other and then exit both regions the music keeps playing and it throws the error in the console every time.
I also noticed that if you enter and then exit the region the music will stop playing but as soon as the song would have ended (if you stayed) it plays it again outside the region.
Thank you so much for making this plugin. I just found it and I LOVE it! <3
The chirp music disc is great background music when entering a market area imo :)
@deleted_10274781
Thanks! I don't know french, but Its awesome anyway! :D
Here is a french tutoriel for your plugin : http:ttlegend2011.p.ht/2013/03/regionjukebox-pour-ajouter-des-musiques-a-vos-regions/
Could i add custom music?
@FunnyGopher
It's the same problem unga is having.
Edit: I should note that I am with McBirdCraft
@McBirdCraft
In the future, the bit you pasted is not very helpful. All I can read from that is exactly what you can, that it couldn't pass the event to my plugin. Why? that's what you have to paste. All the big garble jarble that comes underneath it is what is needed to understand the problem. :)