brennanw1lls735-cell

can you make me a INVENTORY GUI based plugin that allows me to play custom music, by URL.

Kodari AI
KodariAug 18 at 5:52 am 2
MusicPlayerGUI
A Bukkit plugin providing a GUI-based custom music player. Players open a chest inventory menu displaying available songs as clickable items. Each song is loaded from a configurable URL, allowing server admins to add custom audio tracks. The plugin uses a button-based inventory system where clicking a song item plays the music for the player. Features include a main music selection GUI, configurable song list with URLs, and automatic cleanup of active inventories. Built on a reusable inventory GUI framework with lazy initialization and centralized event management.
  1. Create the Gradle Bukkit project and plugin metadata.

  2. Add persistent URL track storage, resource-pack generation/hosting, and playback state handling.

  3. Add the reusable inventory GUI, commands, permissions, and configuration for OGG URL playback.

Created a complete inventory-based URL music plugin.

Features:

  • /music opens the GUI.

  • Tracks are displayed as clickable inventory items.

  • /music add <name> <ogg-url> adds URL-hosted OGG tracks.

  • /music play <id> plays a track.

  • /music stop stops playback.

  • /music list lists available tracks.

  • /music remove <id> removes tracks.

  • Persistent storage in plugins/KodariUrlMusic/music.yml.

  • Downloads audio and generates Minecraft resource packs automatically.

  • Includes a built-in HTTP server for serving generated packs.

  • Includes permissions:

    • kodari.music.use

    • kodari.music.manage

Before playing music, configure this in config.yml:

YAML
resource-pack:
  public-url: "http://your-public-ip:8123/packs/"

The audio URLs must provide downloadable OGG files, since Minecraft resource packs do not directly support MP3 playback.

brennanw1lls735-cell

can you make the plugin author _1TECHY1_

Kodari AI
KodariAug 18 at 5:52 am 1

Updated the plugin author to _1TECHY1_ in plugin.yml.

brennanw1lls735-cell

can you update it and make it support downloaded mp4 files that just get put into the generated packs folder.

Kodari AI
KodariAug 18 at 6:03 am 1
  1. Update track storage and download handling for MP4 files.

  2. Place downloaded audio in the generated resource-pack folder with valid resource-pack paths.

  3. Update playback/resource-pack generation and configuration so existing URL tracks continue to work.

Updated the plugin to support MP4 URLs:

  • MP4 files are downloaded into:

    Plain Text
    plugins/KodariUrlMusic/generated-packs/<track-id>.mp4
    
  • Existing OGG URLs still generate playable Minecraft resource packs.

  • /music add <name> <ogg-or-mp4-url> now accepts both formats.

  • Removing a track also deletes its downloaded MP4 file.

  • MP4 downloads respect the configured timeout and maximum file size.

Important limitation: Minecraft resource packs cannot play MP4 audio directly. MP4 files are downloaded and stored as requested, but playable music still needs to be provided as OGG files.

brennanw1lls735-cell

can you create a resourcepack?

Kodari AI
KodariSep 5 at 7:46 pm 1
  1. Inspect the current pack generator and playback path.

  2. Add a valid Minecraft resource-pack structure with pack.mcmeta, sounds JSON, and downloaded media placement.

  3. Wire generation into the existing plugin without changing the GUI or commands.

Updated the plugin to generate a resource-pack ZIP for downloaded MP4 tracks.

Generated files now include:

Plain Text
plugins/KodariUrlMusic/generated-packs/
├── <track-id>.mp4
└── <track-id>.zip

The generated ZIP contains:

Plain Text
pack.mcmeta
assets/kodari_music/sounds.json
assets/kodari_music/sounds/tracks/<track-id>.mp4

The resource pack is generated automatically when an MP4 is downloaded.

Important limitation: Minecraft does not support MP4 audio in resource packs. The ZIP is created and contains the MP4, but Minecraft will only reliably play supported resource-pack audio such as .ogg.

brennanw1lls735-cell

can you make a resourcepack for the plugin?

Kodari AI
KodariSep 9 at 6:03 am 1
  1. Inspect the current resource-pack generator and plugin lifecycle.

  2. Add a valid resource-pack template with pack.mcmeta and sound definitions.

  3. Ensure the plugin creates/updates the pack automatically in its generated-packs folder.

Created the resource-pack support.

The plugin now creates this file on startup:

Plain Text
plugins/KodariUrlMusic/generated-packs/KodariUrlMusic-template.zip

It contains:

Plain Text
pack.mcmeta
assets/kodari_music/sounds.json

OGG tracks continue generating playable packs:

Plain Text
plugins/KodariUrlMusic/generated-packs/<track-id>.zip

MP4 files are downloaded as:

Plain Text
plugins/KodariUrlMusic/generated-packs/<track-id>.mp4

Minecraft resource packs cannot play MP4 audio directly, so MP4 files are stored but require conversion to OGG for in-game playback.

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
settings.gradle
Code
20 1,155
src/main/java/com/kodari/urlmusic/MusicPlugin.java
package com.kodari.urlmusic;

import com.kodari.urlmusic.command.MusicCommand;
import com.kodari.urlmusic.data.TrackRepository;
import com.kodari.urlmusic.inventory.gui.GUIListener;
import com.kodari.urlmusic.inventory.gui.GUIManager;
import com.kodari.urlmusic.listener.ResourcePackListener;
import com.kodari.urlmusic.service.MusicService;
import com.kodari.urlmusic.service.ResourcePackManager;
import com.kodari.urlmusic.service.ResourcePackServer;
import org.bukkit.Bukkit;
import org.bukkit.command.PluginCommand;
import org.bukkit.plugin.java.JavaPlugin;

import java.io.IOException;

public class MusicPlugin extends JavaPlugin {
    private TrackRepository trackRepository;
    private ResourcePackManager resourcePackManager;
    private ResourcePackServer resourcePackServer;
    private MusicService musicService;

    @Override
    public void onEnable() {
        saveDefaultConfig();

        trackRepository = new TrackRepository(getDataFolder());
        trackRepository.load();
        resourcePackManager = new ResourcePackManager(this);
        try {
            resourcePackManager.createTemplatePack();
        } catch (IOException exception) {
            getLogger().warning("Could not create the resource-pack template: " + exception.getMessage());
        }

        boolean serverEnabled = getConfig().getBoolean("resource-pack.server.enabled", true);
        if (serverEnabled) {
            String bindAddress = getConfig().getString("resource-pack.server.bind-address", "0.0.0.0");
            int port = getConfig().getInt("resource-pack.server.port", 8123);
            resourcePackServer = new ResourcePackServer(resourcePackManager.getPackDirectory(), bindAddress, port);
            try {
                resourcePackServer.start();
                getLogger().info("Resource-pack server listening on " + bindAddress + ":" + port);
            } catch (IOException exception) {
                getLogger().warning("Could not start the resource-pack server: " + exception.getMessage());
            }
        }

        musicService = new MusicService(this, resourcePackManager);
        GUIManager guiManager = new GUIManager();
        Bukkit.getPluginManager().registerEvents(new GUIListener(guiManager), this);
        Bukkit.getPluginManager().registerEvents(new ResourcePackListener(musicService), this);

        PluginCommand command = getCommand("music");
        if (command != null) {
            MusicCommand musicCommand = new MusicCommand(this, trackRepository, musicService,
                    resourcePackManager, guiManager);
            command.setExecutor(musicCommand);
            command.setTabCompleter(musicCommand);
        }
    }

    @Override
    public void onDisable() {
        if (musicService != null) {
            musicService.shutdown();
        }
        if (resourcePackServer != null) {
            resourcePackServer.stop();
        }
    }
}