Skip to content

Instrument Played Trigger

StavWasPlayZ edited this page Jul 10, 2023 · 1 revision

minecraft:genshinstrument_instrument_played is a trigger for when an instrument sound has been produced by a player.

The trigger has 1 filtering parameter, which is instrument of type item.

NOTE: It is called minecraft:genshinstrument_instrument_played and not genshinstrument:instrument_played because I had issues making Minecraft recognize a different namespace than itself. Regardless of the issue being fixed, the naming won't change that simply for compatibility issues.

Usages

In the mod, it is used as a criterion in the advancement system for giving out different instrument-related achievements to the player. Below is an example of the Windsong Lyre's advancement JSON:

{
    // parent & display stuff

    "criteria": {
        "instrument_played": {
            "trigger": "genshinstrument_instrument_played",

            "conditions": {
                "instrument": {
                    "items": ["genshinstrument:windsong_lyre"]
                }
            }
        }
    },

    "requirements": [
        ["instrument_played"]
    ]
}
Clone this wiki locally