The m4m planning thread (music4minecraft)

###:musical_note: What is it?

Hey guys, I’m back with another planned plugin for Sponge! :smiley:
music4minecraft (or short: m4m) is a custom music plugin for your server. You can create a playlist based on some selectors, and dependent on the in-game environment, your players will listen to awesome music perfect for what they do on your server at the moment.

###:musical_note: How does it work? Minecraft does not support custom music!
I know that, and there are two solutions for this, both of them can be used in m4m:

  1. A Minecraft mod (recommended). This makes the communication between server and client easy and will display ingame notifications about the current playing track.
  2. A web app. The plugin has a built-in webserver (default: http://localhost:13413/) that serves a widget you can embed in the existing server website and a simple standalone web client. You can customize everything if you want, but the default configuration should be fine for most servers.

For the web client you need to forward/allow/use a port at the server, however this is not needed if your players only use the mod.
The mod will also work in Singleplayer on custom maps as it will be completely chat-based and can be triggered by command blocks.

###:musical_note: What can I do with it?
You can write a playlist file (or use an existing one) where you tell the plugin: “If the player is in this situation, then play one of those tracks from youtube after the last track has ended.” This is called a selector.
You can also tell the plugin: “If the player ever comes into this exact situation, immediately stop his track and play one from this list.” - Then, this selector is called a trigger.
You can also combine multiple selectors and triggers.
This is a growing list of what will be possible:

  • Music dependent on the ingame time
  • Biome-dependent music
  • World-dependent music
  • Music for specific light levels
  • Play different music if the player is in the cave
  • Music in a specific area
  • Music on command (trigger only)
  • Other plugins can register selectors via the API

###:musical_note: Where does the music come from?
You will be able to use music from YouTube only at the current state.
Later I will eventually add SoundCloud and Deezer or something like that (unfortunately, Spotify got a pretty bad API…)

###:musical_note: How far are you with development?
I did create m4m half a year ago for our private minecraft server with only the web client, it worked pretty well with Bukkit, but it was missing an API and the code was pretty messy. This will be a complete rewrite for Sponge, and it will be awesome! :wink:

The new implementation will be Open Source, so you can help with the development! I’ll setup a GitHub repository soon. :smiley:

:ballot_box_with_check: Plan the configuration file syntax

:ballot_box_with_check: Plan the communication between server and client

:ballot_box_with_check: Plan the API for other plugins to hook into m4m (1/18/2015)

:black_large_square: Code the Forge Client Mod (January)

:black_square_button: Code the API implementation and the core plugin (January/February)

:black_square_button: Code the main selectors (February)

:black_large_square: Make the web app and the widget API work (February)

:black_square_button: Release m4m (late February)

###:musical_note: Links to the latest updates

If you got an idea for a new selector, a better name for the plugin or just anything you want to tell me, put it down right there in the reply section. :smiley:


This seems pretty nice, I think the webapp is the most viable option for you as requiring users to install mods is going to substantially decrease your player base. I would consider other methods such as possibly a small Teamspeak server that has a music bot that is controlled by the minecraft server, players could also connect to a specific channel on it to listen in as many large servers have teamspeak servers and many minecraft players commonly use teamspeak so it would not be a huge step out of their way. That might require a certain amount of programming skill outside of bukkit so I don’t know if that is a viable option for you.

TeamSpeak has the huge problem that it’s pretty proprietary. You can’t just code things for it, you’d need to hack the protocol, and this probably heavily violates their ToS… :worried:
Also, on a TS, there are multiple people, so who should listen to which music? I think here a “normal” TS3 music bot (which is btw just a Windows server running a TeamSpeak client and a music player) would come more handy…
It’s a great idea to control what the bot is playing by a plugin that tells the bot if it rains and what time it is, but that’s too complicated for a standalone plugin… Maybe custom-made for a server running on a Windows host… :wink:

The webapp is pretty easy to use, but the mod has a few advantages (singleplayer, notifications, …), so it’s recommended for players. Every server always serves both possibilities. :smiley:

The webapp would have to recognise the user, otherwise, you get the same problem as in TeamSpeak. Never the less, it’s a great idea!

Ok, I was referring to more of a protocol hack, possibly make your own external bot that just hangs out on a specific channel streaming music controllable via post requests. It sounds like you think thats a bit beyond you though. Just a suggestion. This plugin sounds really nice either way. Could use it to play epic music on a RPG server I’ve been working on :stuck_out_tongue:

EDIT: Oh, yes you would only be able to play one track through TeamSpeak, that is a limitation… trying to get a unique stream for every play like that would be near impossible.

Instead of a unique stream, the plugin could send instructions of which sounds to play; the sounds would have to be previously cached.

The server compares the IP addresses to find out which user is listening. If there are more players behind the same router, it will ask for the player name…
And the server only sends the youtube link to the client. Also makes it more lightweight than any TS solution :smiley:

@RobodudeMC As I said, a standalone TS bot is impossible to combine with their ToS. Even uses the official client as a backend :wink:

1 Like

There is a Teamspeak SDK you can use and creating a separate application that emulates their protocol is legal as long as it was not decompiled from their program. It would not be hard to create a program that implements the same protocol as the plugin is interfacing with. There would be very little load on the plugin itself. Like I said before you would put the load on a program you developed yourself that is completely seperate from MC. I know you are not interested, but I don’t think you should dismiss the idea entirely.

TeamSpeak did a pretty decent job at not allowing bots… :smile:

It is noteworthy to understand that projects utilizing the TeamSpeak 3 SDK cannot make use of the TeamSpeak 3 Client and Server.

And hacking the protocol is pretty much not something I want to do right now :smiley:

I think I’ll dismiss the idea for now, maybe if I purchase a music bot I can hook into their web interface, but that’s nothing too professional and probably not worth the effort… :smiley:

I think I remember an old spoutcraft plugin that did this idea a couple year ago. I look forward to how you guys do this idea.

what i remember as a spoutcraft plugin was a jukebox plugin that played music uploaded to the server and played it for anyone in range like a regular jukebox with a cd in it
that plugin was 10/10 amazing for me to randomly blast music out of my house and annoy the living hell out of people and also probably had security flaws in it

1 Like

@Kevin96AT Although it’s amazing what can be done with noteblocks (this :wink:), I don’t want to listen to that “minecrafty” music style for more than a few minutes if I can have things like this playin’ on my server… :smiley:

@Waterpicker Yeah, someone on my server told me something like that existed, but he didn’t know the name anymore, and I didn’t find anything similar - so I started coding this plugin :wink:

that’s the one
when i found the server that showed me it and it closed i just hunted for another server that had it just so i can blast random music -w-

its fun

I wanna mention, that you CAN play custom sounds/music in vanilla Minecraft that do NOT need to replace default sounds as most people think.
You just need the client to load a resource pack from the server that contains all the sounds/music you wanna use with a sounds.json that registers those sounds with a unique name/label (whatever you call it)

But streaming music (I assume you do) obviously doesn’t require you to download anything, and you can simply change it at runtime :smiley:
And you can just stop the sounds (i couldn’t get game sounds to stop ^^)

1 Like

@DosMike Yep, that would require downloading everything at once. Streaming from YouTube is faster and is better for updating the configuration :smiley:

By the way, this is the current draft of the web app:
The accent and background colors, default stream name and icon, title, subtitle and logo are all fully customizable.

Client Mod Release! (v0.1 Alpha) :smile:

Okay, now you can all se how great I am at planning my time, but at least it is going forward, even if slowly! :smiley:

You can now download and test the client mod for Forge, finally!
It will not do anything at first glance right now (as the plugin is not done yet), but you can play and stop music from command blocks with following commands:

/tellraw @a "[m4m/play] Dragons; Mineworks; volume=80; start=10; end=3:01; loop"

/tellraw @a "[m4m/stop]"

It will basically accept any command in this form per chat, and that will be how the plugin works.
Also, if you join a server (and when a track ends), the plugin theoretically sends the “/m4m request” command to the server to wait for a new song.

:page_facing_up: Source

:arrow_down: Download

New planning list

(Why can’t I edit the first post anymore?!)


How about “Juke” as a more contextual name? No mysterious acronyms, and no numbers. :smiley:


How do you add the songs if the web app isn’t final? It would be super useful to know, because seeing that the client mod has been released for open testing, I would like to test it. I know that you have a draft of the web app. But how do you add songs to play in game?


I am certain that this project is dead.