Interface SoundEvent

All Superinterfaces:
Keyed, Wrapper
All Known Subinterfaces:
BukkitSoundEvent

@NullMarked @AsOf("2.4.1") public interface SoundEvent extends Wrapper, Keyed
Wraps a Minecraft SoundEvent.
Since:
2.4.1
  • Method Details

    • location

      @AsOf("2.4.1") ResourceKey location()
      Gets the location of the sound event.
      Returns:
      the location of the sound event
      Since:
      2.4.1
    • fixedRange

      @AsOf("2.4.1") Optional<Float> fixedRange()
      Gets the range of the sound event.
      Returns:
      the range of the sound event, if present
      Since:
      2.4.1
    • variableRange

      @AsOf("2.4.1") static SoundEvent variableRange(ResourceKey location)
      Creates a new sound event with a variable range.
      Parameters:
      location - the location of the sound event
      Returns:
      a new sound event with a variable range
      Since:
      2.4.1
    • fixedRange

      @AsOf("2.4.1") static SoundEvent fixedRange(ResourceKey location, float range)
      Creates a new sound event with a fixed range.
      Parameters:
      location - the location of the sound event
      range - the range of the sound event
      Returns:
      a new sound event with a fixed range
      Since:
      2.4.1
    • variableRange

      @AsOf("3.1.0") static SoundEvent variableRange(String key)
      Creates a new sound event with a variable range.
      Parameters:
      key - the key of the sound event
      Returns:
      a new sound event with a variable range
      Since:
      3.1.0
    • fixedRange

      @AsOf("3.1.0") static SoundEvent fixedRange(String key, float range)
      Creates a new sound event with a fixed range.
      Parameters:
      key - the key of the sound event
      range - the range of the sound event
      Returns:
      a new sound event with a fixed range
      Since:
      3.1.0
    • variableRange

      @AsOf("3.1.0") static BukkitSoundEvent variableRange(Sound sound)
      Creates a new BukkitSoundEvent with a variable range.
      Parameters:
      sound - the sound event to create a BukkitSoundEvent from
      Returns:
      a new BukkitSoundEvent with a variable range
      Since:
      3.1.0
    • fixedRange

      @AsOf("3.1.0") static BukkitSoundEvent fixedRange(Sound sound, float range)
      Creates a new BukkitSoundEvent with a fixed range.
      Parameters:
      sound - the sound event to create a BukkitSoundEvent from
      range - the range of the sound event
      Returns:
      a new BukkitSoundEvent with a fixed range
      Since:
      3.1.0
    • decode

      @AsOf("3.3.0") static SoundEvent decode(Object minecraftSoundEvent)
      Reads a Minecraft sound event, or a holder of one, into a wrapper.
      Parameters:
      minecraftSoundEvent - the sound event to read
      Returns:
      the wrapper for it
      Since:
      3.3.0