Package org.bukkit
Class MusicInstrument
java.lang.Object
org.bukkit.MusicInstrument
- All Implemented Interfaces:
- Keyed,- RegistryAware
- 
Field SummaryFieldsModifier and TypeFieldDescriptionstatic final MusicInstrumentstatic final MusicInstrumentstatic final MusicInstrumentstatic final MusicInstrumentstatic final MusicInstrumentstatic final MusicInstrumentstatic final MusicInstrumentstatic final MusicInstrument
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionstatic MusicInstrumentgetByKey(NamespacedKey namespacedKey) Deprecated.abstract StringGets the description of this instrument.abstract floatGets how long the use duration is for the instrument.abstract NamespacedKeygetKey()Deprecated.A key might not always be present, useRegistryAware.getKeyOrThrow()instead.abstract floatgetRange()Gets the range of the sound.abstract SoundGets the sound/sound-event for this instrument.static Collection<MusicInstrument> values()Deprecated.useIterable.iterator().Methods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.bukkit.registry.RegistryAwaregetKeyOrNull, getKeyOrThrow, isRegistered
- 
Field Details- 
PONDER_GOAT_HORN
- 
SING_GOAT_HORN
- 
SEEK_GOAT_HORN
- 
FEEL_GOAT_HORN
- 
ADMIRE_GOAT_HORN
- 
CALL_GOAT_HORN
- 
YEARN_GOAT_HORN
- 
DREAM_GOAT_HORN
 
- 
- 
Constructor Details- 
MusicInstrumentpublic MusicInstrument()
 
- 
- 
Method Details- 
getDurationpublic abstract float getDuration()Gets how long the use duration is for the instrument.- Returns:
- the duration.
 
- 
getRangepublic abstract float getRange()Gets the range of the sound.- Returns:
- the range of the sound.
 
- 
getDescriptionGets the description of this instrument.- Returns:
- the description.
 
- 
getSoundEventGets the sound/sound-event for this instrument.- Returns:
- a sound.
 
- 
getKeyDeprecated.A key might not always be present, useRegistryAware.getKeyOrThrow()instead.Return the namespaced identifier for this object.
- 
getByKey@Nullable @Deprecated(since="1.20.1") public static MusicInstrument getByKey(@NotNull NamespacedKey namespacedKey) Deprecated.UseRegistry.get(NamespacedKey)instead.Returns aMusicInstrumentby aNamespacedKey.- Parameters:
- namespacedKey- the key
- Returns:
- the event or null
 
- 
valuesDeprecated.useIterable.iterator().Returns all known MusicInstruments.- Returns:
- the memoryKeys
 
 
- 
Registry.get(NamespacedKey)instead.