I am no longer working on this plugin. It seems like it is not working for Minecraft Server versions past 1.8
MusicalBlocks is a minecraft minigame where players listen to music while running around on a colored floor. After some time, they are given a color to stand on. If they don't manage to stand on this color after some time, they're out. The last player surviving wins.
- Fun and popular minigame
- Players listen to really music using a web browser (website included) -> not just noteblock sounds.
- Custom templates supported
- Or let the plugin create them randomly every game
- Fully customizable website
- Default website and translations included
This plugin is, at the moment, in a beta phase. It is actively developed. If you find bugs, encounter problems or have suggestions, send me a PM and I'll try to solve it. Please don't leave a bad rating just because of bugs but tell me about them so I can fix them.
Servers using this plugin:
- More power-ups
- More customization for the Bukkit plugin
If you want to see a running demonstration of this plugin, you might want to join one of the following servers:
Send me a PM to have your server listed here.
- TheGearMC (IP: mc.thegearmc.com)
I know, this is quite complicated. But trust me, it's going to be worth it!
- A fresh Bukkit server. This minigame requires a bukkit instance for each game.
- A BungeeCord server
- A web server running php. Don't have one? No worries: Some providers offer small servers for free. A search for "free webhosting" might help. Please take note that these hosters might place ads on your website.
Download the resource file and unzip it. The "MusicalBlocksBungee.jar" file goes into the plugins folder of your BungeeCord server, the "MusicalBlocksBukkit.jar" and BossBarAPI in the plugins folder of your new Bukkit server and the contents of the "Website" folder should be uploaded into a subdirectory of your web server.
Replace the world folder of your Bukkit server with the world folder from this resource. You can, however, change the world later. Restart both BungeeCord and Bukkit (don't worry about the exception there, it will be gone after a correct configuration) and continue with step Configuration.
In order to make hosting multiple games as easy as possible, most configuration for the bukkit plugin is stored on the web server. The plugin will download it so you don't have to configure every of your servers running this plugin.
That's probably the easiest part. The BungeeCord plugin has created a file called "config.yml" in it's plugin folder (plugins/MusicalBlocksBungee). This config specifies the port for the websocket server. This server will be started by the plugin. You can use any free port you want to. This port is required to exchange data between web browsers, BungeeCord and the Bukkit servers in real time.Bukkit:
The plugin has created a config.yml in it's plugin folder (plugins/MusicalBlocks). It tells the plugin about where to search for the configuration files on the web server. If you don't know what you're doing, leave protocol as it is. Change address to the domain or IP Address of your web server.Web:
Path is the path of the files you uploaded in the previous step. For instance, if you have uploaded the contents of the "Website" folder into a folder called "mb" on your webserver, this would be "/mb/".
Open the file config.inc.php using a text editor. The things you can edit are:And that's all for the configuration. Now, upload the changed config.inc.php to the web server so that it replaces the old one and restart the Bukkit and the BungeeCord server if you haven't already.
- The language (line 3). The available options at the moment are "en" (default) and "de". If you want to translate the website to your language, copy lang/en.php to lang/yourLang.php and edit that file. If you do that, it would be nice to give me that file so I can make it available for others.
- Server name (line 5). This is just used to display the title. Enter your server name here.
- Server IP (line 6). Just like the server name, for display only. Visitors of the site are being given this IP to connect to your server.
- Websocket Address (line 7). This is important. It's your BungeeCord IP, followed by a colon ( : ) and the port specified in the BungeeCord configuration section.
- Description (line 8). This is a part of a web site shown in search engines.
- Video demonstration URL (10). If you have made a showcase of the plugin, insert the link here. There's a button on the website pointing to that URL.
- Social stuff: At the bottom of each page, some links are shown with icons. To add more, write "$social["brandname"] = "link"; in a new line. All supported brand names can be found here.
- Minimum and maximum players: This should be obvious. The game won't start with less than minPlayers online and it won't allow more than maxPlayers to join.
- Music. The downloaded resource comes with two music tracks by Kevin MacLeod. To add another music track, copy/paste the construct in a new line. Adapt author and title, make sure no trackId exists twice and upload the music track inserted to music/<trackid>.mp3. It's important to use mp3 as it's the only file format all common browsers support. To remove a track, simply remove the mp3 file and the lines describing it. Important: Make sure you are allowed to upload the mp3 files and let users listen to them!
- Locations: This sections specifies the location of the gameboard. Since the entire board has the same height, you specify y just once. Specify the minimum / maximum locations and the plugin will use the rectangle. If you use the default world, you can ignore this and move on.
- Game boards (templates). This is a list of templates to choose from. There must be at least two for the plugin to work. Each consists of a type and, optionally, some data. The available types are custom, random and singlecolor. Singlecolor is, of course, incredibly boring, and it shouldn't be used. If you do use it, make sure to include data, for instance array("type"=>"random", "data"=>3). The value for data is the dye color used by minecraft. For random, no data is required. To create custom templates, read the section below as it's a bit more complicated.
- Highscore locations. Start is the location of the first sign, excluding the description signs. This is the sign containing some data for the first place for the first category. columnDir describes the directions for the places. For instance, if the sign for the second place is z+1 of the first sign, the columnDir would be south. If you use the default world, you can ignore this and move on.
- Highscoreorder will have a meaning in a future version of MusicalBlocks. For now, just move on.
- The start scoreboard is shown at the beginning of the game. You can configure the title and the entries. To turn it off, set "enabled" to false.
The scoreboard exists to display some news to players. But feel free to use it (or don't) like you want it to use.
Now the plugin is ready to be used. In order to be able to listen to music, visit <yourwebsite>/<yourdir>/listen.php or type /listen in the chat and let the plugin figure out the URL for you.
Creating and using custom boards:
The resource contains a jar file you don't need to upload on any servers: CustomFieldCreator.jar. It creates a custom field from an image file. So first of all, create an image file. That file should not contain opacity and should have a size corresponding to the size of your gameboard. If your file is smaller, the rest will be filled with white (doesn't look to well) and if it's bigger, it will be cropped.
Now open a terminal and execute "java -jar CustomFieldCreator.jar <yourimagefilehere> <youroutputfilehere>". The program has now created a json file representing the colors in your input image. Upload the resulting file to your web server, so that it's in the same directory as your config.inc.php. Now, open config.inc.php with a text editor. To include the template you just created, include a boardFromFile("yourfilename") in $gameBoards, like this: $gameBoards = array(array("type"=>"random"), array("type"=>"random"), boardFromFile("myCreatedFile"))
Important when creating own templates: Your file should only contain the following colors: #FFFFFF, #D87F33, #B24CD8, #6688D8, #E5E533, #7FCC19, #F27FA5, #4C4C4C, #999999, #4C7F99, #7F3FB2, #334CB2, #664C33, #667F33, #993333 and #191919. If your file contains other colors, the program will change them to one of these. These restrictions come from minecraft, as there are only 16 ways to color a stained clay block.
Design tip: Testing shows that, for some players, it's hard to distinguish between black and brown and between pink and magenta. My advise is not to put them in the same map. If you do, make sure to put them next to each other so players can easily spot the difference.
Protecting information stored on the webserver
When uploading the website on your webserver, it is, by default, accessible by the public. This makes sense, because players will have to access your site in order to be able to listen to music.
But the api/bukkit.php should be an exception, because it may display sensitive information in an upcoming version of MusicalBlocks, such as database credentials needed by the plugin in order to save stats. Most webservers offer to block certain requests. Here, you'll want to block every request not coming from one of your bukkit servers.
In Apache, you can achieve this by placing a .htaccess file in the directory containing the sensitive data. For us, this is the api folder, so please create an .htaccess file with this content:
Code (Text):Order deny,allow[/SIZE][/SIZE][/SIZE][/SIZE][/SIZE][/SIZE]
[SIZE=5][SIZE=4][SIZE=5][SIZE=4][SIZE=5][SIZE=4]Deny from all
Allow from 127.0.0.1
You will, of course, have to replace the last two lines with a list of allowed IP addresses in the form of Allow from <ip>. If the bukkit server runs on the same computer as your webserver, 127.0.0.1 should work as well. Please don't use host names as they might slow down your webserver.
For more information about this, see this documentation entry for the apache webserver.