Low priority issue, but the Goat Horn can be blown under water. I was able to sound a Seek Goat Horn while swimming, while playing on Minecraft 1.19 Realms.
Code Analysis done by @unknown seen here
Attachments
Comments 4
I can also confirm this behavior in 1.19.2. Here's a code analysis regarding this issue.
Code Analysis:
The following is based on a decompiled version of Minecraft 1.19.2 using Mojang mappings.
net.minecraft.world.item.InstrumentItem.java
public class InstrumentItem extends Item {
...
@Override
public InteractionResultHolder<ItemStack> use(Level level, Player player, InteractionHand interactionHand) {
ItemStack itemStack = player.getItemInHand(interactionHand);
Optional<Holder<Instrument>> optional = this.getInstrument(itemStack);
if (optional.isPresent()) {
Instrument instrument = optional.get().value();
player.startUsingItem(interactionHand);
InstrumentItem.play(level, player, instrument);
player.getCooldowns().addCooldown(this, instrument.useDuration());
return InteractionResultHolder.consume(itemStack);
}
return InteractionResultHolder.fail(itemStack);
}
...
If we look at the above class, we can see that there is only one check carried out before goat horns can be used, (the INSTRUMENT_PLAY
sound event can be played). This check is to simply see if the item that the player is holding is a goat horn and whether or not it's currently on cooldown. If not the player is holding a goat horn that is not on cooldown, the goat horn will be used and the INSTRUMENT_PLAY
sound event will be played. No checks are carried out to see if the player is underwater when using this item, thus allowing it to be played here.
It's intentional, you can use goat horns everywhere in Minecraft