Noah Gordon

Make this a mod and fabric 1.21.11

📎 1 file 2,948 chars
📄
pasted-code-1793788007229.txt
txt 31 lines
▶
Minecraft Mod Description - "Nebula Player"

Nebula Player is a fully integrated in-game music streaming and playback mod for Minecraft, designed with a sleek futuristic interface inspired by modern desktop music applications. The mod opens through a customizable keybind and displays a glassmorphism-themed UI that seamlessly overlays the Minecraft world without interrupting gameplay.

The main dashboard features a large animated album cover on the left, accompanied by a rotating vinyl effect when music is playing. Beneath the artwork, players can view the current song title, artist name, album information, and optional synced lyrics. Dynamic audio visualizers at the bottom react in real-time to music, creating an immersive listening experience.

A vertical navigation panel provides access to multiple sections:

Home - Displays recently played songs, favorite albums, playlists, and personalized recommendations.

Library - Organizes saved tracks, albums, playlists, podcasts, and local audio files imported directly into the mod.

Now Playing - A dedicated page showcasing enlarged album artwork, playback progress, lyric synchronization, and music controls.

Playlists - Allows players to create, edit, and manage custom playlists without leaving Minecraft.

Lyrics - Displays smooth real-time synchronized lyrics floating beside the player interface or as an optional HUD overlay.

Themes - Customize accent colors, backgrounds, transparency, animations, and interface layouts.

Settings - Configure audio quality, keybinds, lyric appearance, download options, notifications, and device behavior.

At the bottom of the interface is an elegant playback bar featuring Previous Track, Play/Pause, Next Track, Shuffle, Repeat, and Volume controls. A responsive seek bar allows players to jump to any point in a song instantly.

The mod supports popular music services through account integration, allowing users to stream libraries, synchronize playlists, and continue listening across devices. Offline playback is available for downloaded tracks. Advanced caching ensures minimal performance impact even on lower-end systems.

An optional compact HUD mode shows the current song, album artwork, playback controls, and progress directly on the game screen. Players can move, resize, and customize this widget to match any Minecraft HUD setup.

Additional features include Discord Rich Presence integration, animated backgrounds, customizable visualizers, keyboard media controls, crossfade transitions between songs, smart recommendations, and multiplayer listening sessions where friends can share synchronized playback.

Designed with performance and aesthetics in mind, Nebula Player transforms Minecraft into a complete multimedia experience, allowing players to explore, build, battle, and adventure while enjoying their favorite music through a beautiful modern interface that feels native to the game.
Kodari AI
KodariNov 4 at 10:37 am 4
NebulaPlayer
NebulaPlayer is a Fabric mod for Minecraft 1.21.1 that brings a fully integrated in-game music streaming and playback interface. It features a glassmorphism-themed UI with an animated album cover, rotating vinyl effect, real-time audio visualizers, and synchronized lyrics. The mod includes a vertical navigation panel for Home, Library, Now Playing, Playlists, Lyrics, Themes, and Settings sections. An elegant playback bar offers Previous, Play/Pause, Next, Shuffle, Repeat, and Volume controls with a responsive seek bar. It supports music service account integration, offline playback, advanced caching, an optional compact HUD widget, Discord Rich Presence, crossfade transitions, and multiplayer synchronized listening sessions.
  1. Set up the Fabric 1.21.11 mod and client entrypoints.

  2. Build the owo-ui music dashboard and open it with a customizable keybind.

  3. Add local WAV playback, playlist controls, and a compact playback HUD.

Created Nebula Player for Fabric 1.21.11, with an owo-ui dashboard, a remappable M keybind, a compact playback HUD, and local WAV playback controls. The library saves imported file paths in the game’s config folder; the home screen includes a rotating record effect and selectable accent themes.

This version supports local WAV files only. Music-service accounts and streaming, synced lyrics, MP3 decoding, downloads, Discord Rich Presence, and multiplayer listening are not implemented.

Noah Gordon

Is it a mod for fabric 1.21.11

Kodari AI
KodariNov 4 at 10:39 am 1

Yes. It’s a Fabric mod for Minecraft 1.21.11. Switch to Fabric mod for Minecraft 1.21.11

Noah Gordon

Can you make it so it comes predownloaded with songs and so it doesnt take up the full screen, Make it so you can search songs up and can add them from there. Make it like you can link your spotify and get the playlists from there

Kodari AI
KodariNov 5 at 4:42 am 3
  1. Add bundled, original tracks.

  2. Make the player a compact, non-full-screen window.

  3. Add song search and queueing.

  4. Add Spotify playlist linking, subject to Spotify’s authorization and playback limits.

Updated Nebula Player with:

  • Three included original ambient tracks that work offline; they’re generated by the mod, not downloaded commercial songs.

  • A compact 470 × 330 window that leaves the rest of the game visible.

  • Search for included and imported tracks, plus Spotify catalog search.

  • Spotify sign-in, playlist browsing, and the ability to add search results to a selected Spotify playlist.

To connect Spotify, create a Spotify developer app, add http://127.0.0.1:43839/callback as its redirect URI, then paste its Client ID into the Spotify tab and link your account. Spotify tracks open in Spotify for playback—the mod doesn’t stream Spotify audio in-game.

Noah Gordon

Can you make it so that there is alot more themes and in the top right you are able to hide that text in a "settings" tab. Also make it so that the like screen adjusts to wether you are full screen or not because im currently full screen and it took up everything

Kodari AI
KodariNov 5 at 4:51 am 2
  1. Expand the theme choices and add a Settings tab with a toggle to hide the top-right text.

  2. Make the player window scale and fit the available screen space, including fullscreen.

Added 12 themes and a Settings toggle for the top-right HUD. The selected theme and HUD visibility are saved in config/nebula-player/settings.properties.

The player panel now stays compact on large screens, shrinks to fit smaller viewports, and lets you scroll through page content when space is limited.

Noah Gordon

Also make some themes gradients instead of just 1 color. and can you make it so that instead of having to put in a "secret code" make it so you can click on some text that says "link spotify account" and then it redirects you to a website where you can sign in to spotify, linking it to the music player. Make this a one time thing and make it so everything stays the same when the thing is restarted.

Kodari AI
KodariNov 9 at 8:45 pm 3

Added 18 gradient themes, with each theme previewed in the Themes tab and the selection saved across restarts. Spotify now has a Link Spotify account button that opens browser sign-in; the account refresh token and selected playlist are saved locally, so you won’t need to authorize again after restarting.

One Spotify requirement remains: a first-time connection needs the mod’s public Spotify app Client ID. It isn’t a password or secret, but Spotify requires it for authorization. The in-game paste field is removed; an existing saved Client ID will be reused, while a fresh setup without one will show a status message.

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
gradle.properties
manifest.kod
settings.gradle
Code
11 1,794
src/client/java/com/kodari/nebulaplayer/NebulaClient.java
package com.kodari.nebulaplayer;

import io.wispforest.owo.ui.component.LabelComponent;
import io.wispforest.owo.ui.component.UIComponents;
import io.wispforest.owo.ui.container.FlowLayout;
import io.wispforest.owo.ui.container.UIContainers;
import io.wispforest.owo.ui.core.Color;
import io.wispforest.owo.ui.core.Insets;
import io.wispforest.owo.ui.core.Positioning;
import io.wispforest.owo.ui.core.Sizing;
import io.wispforest.owo.ui.core.Surface;
import io.wispforest.owo.ui.hud.Hud;
import net.fabricmc.api.ClientModInitializer;
import net.fabricmc.fabric.api.client.event.lifecycle.v1.ClientTickEvents;
import net.fabricmc.fabric.api.client.keybinding.v1.KeyBindingHelper;
import net.minecraft.client.MinecraftClient;
import net.minecraft.client.option.KeyBinding;
import net.minecraft.util.Identifier;
import org.lwjgl.glfw.GLFW;

import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Path;
import java.util.Properties;

public class NebulaClient implements ClientModInitializer {

    public static final String MOD_ID = "nebula_player";
    private static final Identifier HUD_ID = Identifier.of(MOD_ID, "compact_player");
    private static final KeyBinding.Category KEY_CATEGORY = KeyBinding.Category.create(Identifier.of(MOD_ID, "main"));
    private static final KeyBinding OPEN_PLAYER = new KeyBinding("key.nebula_player.open", GLFW.GLFW_KEY_M, KEY_CATEGORY);

    private static LabelComponent hudLabel;
    private static Path settingsFile;
    private static boolean hudVisible = true;
    private static int accentColor = 0x4FD1C5;
    private static String themeId = "";

    @Override
    public void onInitializeClient() {
        MinecraftClient client = MinecraftClient.getInstance();
        NebulaAudioPlayer.initialize(client.runDirectory.toPath());
        SpotifyIntegration.initialize(client.runDirectory.toPath());
        loadSettings(client.runDirectory.toPath());
        KeyBindingHelper.registerKeyBinding(OPEN_PLAYER);

        if (hudVisible) {
            registerHud();
        }

        ClientTickEvents.END_CLIENT_TICK.register(tickClient -> {
            while (OPEN_PLAYER.wasPressed()) {
                tickClient.setScreen(new NebulaPlayerScreen());
            }

            if (hudLabel != null) {
                NebulaAudioPlayer player = NebulaAudioPlayer.get();
                String text = "♫ " + player.currentTitle() + " · " + player.status();
                if (!hudLabel.text().getString().equals(text)) {
                    hudLabel.text(NebulaText.literal(text));
                }
            }
        });
    }

    private static void registerHud() {
        Hud.add(HUD_ID, () -> {
            hudLabel = UIComponents.label(NebulaText.literal("♫ Nebula Player"));
            hudLabel.color(Color.ofRgb(0xE6EDF3));
            hudLabel.maxWidth(240);

            FlowLayout panel = UIContainers.horizontalFlow(Sizing.content(), Sizing.content());
            panel.child(hudLabel);
            panel.padding(Insets.of(5));
            panel.surface(Surface.flat(0xDC101827).and(Surface.outline(0xFF4FD1C5)));
            panel.margins(Insets.of(6));
            panel.positioning(Positioning.relative(100, 0));
            return panel;
        });
    }

    private static void loadSettings(Path gameDirectory) {
        settingsFile = gameDirectory.resolve("config/nebula-player/settings.properties");
        Properties settings = new Properties();
        if (!Files.isRegularFile(settingsFile)) {
            return;
        }

        try (var reader = Files.newBufferedReader(settingsFile)) {
            settings.load(reader);
            hudVisible = Boolean.parseBoolean(settings.getProperty("hud-visible", "true"));
            accentColor = Integer.parseInt(settings.getProperty("accent-color", "4fd1c5"), 16);
            themeId = settings.getProperty("theme-id", "");
        } catch (IOException | IllegalArgumentException ignored) {
            hudVisible = true;
            accentColor = 0x4FD1C5;
            themeId = "";
        }
    }

    private static void saveSettings() {
        if (settingsFile == null) {
            return;
        }

        Properties settings = new Properties();
        settings.setProperty("hud-visible", Boolean.toString(hudVisible));
        settings.setProperty("accent-color", Integer.toHexString(accentColor));
        settings.setProperty("theme-id", themeId);
        try {
            Files.createDirectories(settingsFile.getParent());
            try (var writer = Files.newBufferedWriter(settingsFile)) {
                settings.store(writer, "Nebula Player settings");
            }
        } catch (IOException ignored) {
        }
    }

    public static boolean isHudVisible() {
        return hudVisible;
    }

    public static void setHudVisible(boolean visible) {
        if (hudVisible == visible) {
            return;
        }
        hudVisible = visible;
        Hud.remove(HUD_ID);
        hudLabel = null;
        if (visible) {
            registerHud();
        }
        saveSettings();
    }

    public static int accentColor() {
        return accentColor;
    }

    public static void setAccentColor(int color) {
        accentColor = color;
        saveSettings();
    }

    public static String themeId() {
        return themeId;
    }

    public static void setTheme(String id, int color) {
        themeId = id;
        accentColor = color;
        saveSettings();
    }
}