Instrument definition

Minecraft Wiki article. Categories: Java_Edition, Upcoming, Java_Edition_upcoming, Data_packs

📌 Mirrored from Minecraft Wiki

This article is reproduced from Instrument definition on the Minecraft Wiki. Mirrored from revision 3685669. It is licensed CC BY-NC-SA 3.0 by the Minecraft Wiki contributors — not under the Codex’s CC BY-SA 4.0, and it may not be used commercially. Edits belong upstream, not here.

This feature is exclusive to Java Edition.
 

An instrument consists of a sound with its corresponding range and use duration. They are currently only used for goat horns.

Definition

Instruments can be defined in data packs, as part of the directory structure below.

JSON Format

Instruments are defined using the following format:

  • [NBT Compound / JSON Object] The root object.
    • [NBT Compound / JSON Object] description: A text component that is used as a description in tooltips.
    • [String][NBT Compound / JSON Object] sound_event: One server-side sound event (an [String] ID, or a new [NBT Compound / JSON Object] server-side sound event definition)
    • [Float] use_duration: A non-negative float for how long the use cooldown is. Can't be 0.​[until: 26.3] Can be 0 for no cooldown.​[upcoming: 26.3]
    • [Int] durability_damage​[upcoming: 26.3]: An optional non-negative integer for the amount of durability to consume on each use.
    • [Float] range: A non-negative float for the range of the sound.

History

Java Edition
1.21.224w33aAdded instruments to data packs, used only for goat horns.
Upcoming Java Edition
26.3snap1Added the durability_damage field - optional non-negative integer, amount of durability to consume on each use.
Updated the use_duration field - can now be 0 for no cooldown.

Sources