Download Get Current Song — Minecraft Mods — MetaMods

Get Current Song

Active

Downloads

0

Last update

3 years ago

Versions

1.18 — 1.18.2
Client
Fabric
Utils

Get Current Song

This simple FabricMC mod provides the ability to find out which musical composition is currently playing in Minecraft using special commands.

Available Commands

The mod adds two useful commands to the game:

  • /getsong — displays detailed information about the current melody, including its title and author
  • /getsongid — shows the identifier of the playing composition

It's worth noting that similar information can be viewed on the debug screen (F3).

For Resource Pack Developers

If your resource pack contains custom music, it's recommended to add information about the compositions to the getcurrentsong/song_names.json file. The structure of the JSON object looks as follows:

{
    "name": "composition title (required string parameter)",
    "composer": "composer's name (required string parameter)",
    "soundtrack": "album title (optional string parameter)",
    "trackNumber": "track number in album (optional numeric parameter)"
}

Important: if the album title is specified, the track number must also be specified, and vice versa.

For Mod Developers

To connect this mod's API via Gradle, add the following lines to your build.gradle:

repositories {
    // Other Maven repositories can be located above or below the Modrinth repository
    maven {
        name = "Modrinth"
        url = "https://api.modrinth.com/maven"
        content {
            includeGroup "maven.modrinth"
        }
    }
}

dependencies {
    modApi "maven.modrinth:getcurrentsong:1.0.1"
}

After connecting the API, you'll be able to get information about musical compositions from resource packs using the following methods of the SongNameDatabase class (package io.github.gaming32.getcurrentsong):

  • SongNameDatabase#isInitialized — returns true if information about compositions is loaded. Attempting to read from the database when the value is false may lead to incorrect results
  • SongNameDatabase#getSong — gets data about a composition by name or identifier net.minecraft.util.Identifier, returning a SongNameDatabase.SongInfo object or null if the composition is not found in the database
Project members
Gaming32

Gaming32

Admin

Created: 29 Jan 2022

ID: 6877