Instrument definition

From Minecraft Wiki
Jump to navigation Jump to search
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

[edit | edit source]

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

JSON Format

[edit | edit source]

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 be 0 for no cooldown.
    • [Int] durability_damage: 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.

Vanilla usage

[edit | edit source]
Goat horn ID Description translation key Range Sound event Use duration
ItemSprite goat-horn.png: Sprite image for goat-horn in MinecraftAdmire admire_goat_horn[1] instrument.minecraft.admire_goat_horn 256.0 minecraft:item.goat_horn.sound.4 7.0
ItemSprite goat-horn.png: Sprite image for goat-horn in MinecraftCall call_goat_horn[2] instrument.minecraft.call_goat_horn minecraft:item.goat_horn.sound.5
ItemSprite goat-horn.png: Sprite image for goat-horn in MinecraftDream dream_goat_horn[3] instrument.minecraft.dream_goat_horn minecraft:item.goat_horn.sound.7
ItemSprite goat-horn.png: Sprite image for goat-horn in MinecraftFeel feel_goat_horn[4] instrument.minecraft.feel_goat_horn minecraft:item.goat_horn.sound.3
ItemSprite goat-horn.png: Sprite image for goat-horn in MinecraftPonder ponder_goat_horn[5] instrument.minecraft.ponder_goat_horn minecraft:item.goat_horn.sound.0
ItemSprite goat-horn.png: Sprite image for goat-horn in MinecraftSeek seek_goat_horn[6] instrument.minecraft.seek_goat_horn minecraft:item.goat_horn.sound.2
ItemSprite goat-horn.png: Sprite image for goat-horn in MinecraftSing sing_goat_horn[7] instrument.minecraft.sing_goat_horn minecraft:item.goat_horn.sound.1
ItemSprite goat-horn.png: Sprite image for goat-horn in MinecraftYearn yearn_goat_horn[8] instrument.minecraft.yearn_goat_horn minecraft:item.goat_horn.sound.6

History

[edit | edit source]
Java Edition
1.21.224w33a Added instruments to data packs, used only for goat horns.
26.3snap1 Added 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.

References

[edit | edit source]
[edit | edit source]