Minecraft:Instrument definition: Difference between revisions
From SAS Gaming Wiki
More actions
Sync: updated from Minecraft |
Sync: updated from Minecraft |
||
| (2 intermediate revisions by the same user not shown) | |||
| Line 3: | Line 3: | ||
== Definition == | == Definition == | ||
Instruments can be defined in [[Minecraft:data pack]]s, as part of the directory structure below. | Instruments can be defined in [[Minecraft:data pack]]s, as part of the directory structure below. | ||
| Line 13: | Line 12: | ||
* {{nbt|compound}} The root object.<section begin="json format" /> | * {{nbt|compound}} The root object.<section begin="json format" /> | ||
** {{nbt|compound|description}}: A [[Minecraft:text component]] that is used as a description in tooltips. | ** {{nbt|compound|description}}: A [[Minecraft:text component]] that is used as a description in tooltips. | ||
** {{nbt|string}}{{nbt|compound|sound_event}}: {{json_ref|sound event|inline=1}} | ** {{nbt|string}}{{nbt|compound|sound_event}}: {{json_ref|server-side sound event|inline=1}} | ||
*** {{nbt inherit/sound event}} | *** {{nbt inherit/sound event}} | ||
** {{nbt|float|use_duration}}: A non-negative float for how long the use | ** {{nbt|float|use_duration}}: A non-negative float for how long the use cooldown is. Can't be {{cd|0}}.{{until|26.3}} Can be {{cd|0}} for no cooldown.{{upcoming|26.3}} | ||
** {{nbt|int|durability_damage}}{{upcoming|26.3}}: An optional non-negative integer for the amount of durability to consume on each use. | |||
** {{nbt|float|range}}: A non-negative float for the range of the sound.<section end="json format" /> | ** {{nbt|float|range}}: A non-negative float for the range of the sound.<section end="json format" /> | ||
</div> | </div> | ||
== Vanilla usage == | |||
{| class="wikitable" | |||
! {{Tooltip|Goat horn|Goat horn with default data component}} !! {{Tooltip|ID|Instrument JSON name}} !! {{Tooltip|Description translation key|Translated-type text component translation key}} !! Range !! Sound event !! Use duration | |||
|- | |||
| {{ItemLink|Goat horn|Admire|link=none}} | |||
| {{cd|admire_goat_horn}}<ref>[https://github.com/misode/mcmeta/blob/diff/data/minecraft/instrument/admire_goat_horn.json instrument/admire_goat_horn − misode.mcmeta]</ref> | |||
| {{cd|instrument.minecraft.admire_goat_horn}} | |||
| rowspan="8" | 256.0 | |||
| {{cd|minecraft:item.goat_horn.sound.4}} | |||
| rowspan="8" | 7.0 | |||
|- | |||
| {{ItemLink|Goat horn|Call|link=none}} | |||
| {{cd|call_goat_horn}}<ref>[https://github.com/misode/mcmeta/blob/diff/data/minecraft/instrument/call_goat_horn.json instrument/call_goat_horn − misode.mcmeta]</ref> | |||
| {{cd|instrument.minecraft.call_goat_horn}} | |||
| {{cd|minecraft:item.goat_horn.sound.5}} | |||
|- | |||
| {{ItemLink|Goat horn|Dream|link=none}} | |||
| {{cd|dream_goat_horn}}<ref>[https://github.com/misode/mcmeta/blob/diff/data/minecraft/instrument/dream_goat_horn.json instrument/dream_goat_horn − misode.mcmeta]</ref> | |||
| {{cd|instrument.minecraft.dream_goat_horn}} | |||
| {{cd|minecraft:item.goat_horn.sound.7}} | |||
|- | |||
| {{ItemLink|Goat horn|Feel|link=none}} | |||
| {{cd|feel_goat_horn}}<ref>[https://github.com/misode/mcmeta/blob/diff/data/minecraft/instrument/feel_goat_horn.json instrument/feel_goat_horn − misode.mcmeta]</ref> | |||
| {{cd|instrument.minecraft.feel_goat_horn}} | |||
| {{cd|minecraft:item.goat_horn.sound.3}} | |||
|- | |||
| {{ItemLink|Goat horn|Ponder|link=none}} | |||
| {{cd|ponder_goat_horn}}<ref>[https://github.com/misode/mcmeta/blob/diff/data/minecraft/instrument/ponder_goat_horn.json instrument/ponder_goat_horn − misode.mcmeta]</ref> | |||
| {{cd|instrument.minecraft.ponder_goat_horn}} | |||
| {{cd|minecraft:item.goat_horn.sound.0}} | |||
|- | |||
| {{ItemLink|Goat horn|Seek|link=none}} | |||
| {{cd|seek_goat_horn}}<ref>[https://github.com/misode/mcmeta/blob/diff/data/minecraft/instrument/seek_goat_horn.json instrument/seek_goat_horn − misode.mcmeta]</ref> | |||
| {{cd|instrument.minecraft.seek_goat_horn}} | |||
| {{cd|minecraft:item.goat_horn.sound.2}} | |||
|- | |||
| {{ItemLink|Goat horn|Sing|link=none}} | |||
| {{cd|sing_goat_horn}}<ref>[https://github.com/misode/mcmeta/blob/diff/data/minecraft/instrument/sing_goat_horn.json instrument/sing_goat_horn − misode.mcmeta]</ref> | |||
| {{cd|instrument.minecraft.sing_goat_horn}} | |||
| {{cd|minecraft:item.goat_horn.sound.1}} | |||
|- | |||
| {{ItemLink|Goat horn|Yearn|link=none}} | |||
| {{cd|yearn_goat_horn}}<ref>[https://github.com/misode/mcmeta/blob/diff/data/minecraft/instrument/yearn_goat_horn.json instrument/yearn_goat_horn − misode.mcmeta]</ref> | |||
| {{cd|instrument.minecraft.yearn_goat_horn}} | |||
| {{cd|minecraft:item.goat_horn.sound.6}} | |||
|} | |||
== History == | == History == | ||
| Line 24: | Line 71: | ||
|{{HistoryLine||1.21.2|dev=24w33a|Added instruments to [[Minecraft:data pack]]s, used only for [[Minecraft:goat horn]]s.}} | |{{HistoryLine||1.21.2|dev=24w33a|Added instruments to [[Minecraft:data pack]]s, used only for [[Minecraft:goat horn]]s.}} | ||
|{{HistoryLine|upcoming java}} | |{{HistoryLine|upcoming java}} | ||
|{{HistoryLine||26.3|dev=snap1| | |{{HistoryLine||26.3|dev=snap1|Added the {{cd|durability_damage}} field - optional non-negative integer, amount of durability to consume on each use. | ||
|Updated the {{cd|use_duration}} field - can now be {{cd|0}} for no cooldown.}} | |||
}} | }} | ||
== References == | |||
{{Reflist}} | |||
== Navigation == | == Navigation == | ||
Latest revision as of 11:08, 7 September 2026
Template:Exclusive An instrument consists of a sound with its corresponding range and use duration. They are currently only used for Minecraft:goat horns.
Definition
Instruments can be defined in Minecraft:data packs, as part of the directory structure below.
JSON Format
Instruments are defined using the following format:
- Template:Nbt The root object.<section begin="json format" />
- Template:Nbt: A Minecraft:text component that is used as a description in tooltips.
- Template:NbtTemplate:Nbt: Template:Json ref
- Template:Nbt: A non-negative float for how long the use cooldown is. Can't be Template:Cd.Template:Until Can be Template:Cd for no cooldown.Template:Upcoming
- Template:NbtTemplate:Upcoming: An optional non-negative integer for the amount of durability to consume on each use.
- Template:Nbt: A non-negative float for the range of the sound.<section end="json format" />
Vanilla usage
History
References
Template:Navbox Java Edition technical
Minecraft:de:Bockshorninstrumentendefinition Minecraft:fr:Définition d'instrument de corne de chèvre Minecraft:pt:Definição de instrumento de chifre de cabra Minecraft:zh:山羊角乐器定义格式