Interface Music

All Superinterfaces:
Wrapper

@NullMarked @AsOf("2.4.1") public interface Music extends Wrapper
Wraps the Music environment attribute's music record.
Since:
2.4.1
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Interface
    Description
    static final class 
    Builder for creating music records.
  • Method Summary

    Modifier and Type
    Method
    Description
    Creates a new music record builder.
    static Music
    decode(Object minecraftMusic)
    Reads Minecraft music into a wrapper.
    int
    Gets the maximum delay of the music.
    int
    Gets the minimum delay of the music.
    static Music
    of(SoundEvent sound, int minDelay, int maxDelay, boolean replaceCurrentMusic)
    Creates a new music record.
    static Music
    of(String soundKey, int minDelay, int maxDelay, boolean replaceCurrentMusic)
    Creates a new music record.
    static Music
    of(Sound bukkitSound, int minDelay, int maxDelay, boolean replaceCurrentMusic)
    Creates a new music record.
    boolean
    Gets whether the music should replace the current music.
    Gets the sound of the music.
    Creates a new builder with the same values as this music.

    Methods inherited from interface Wrapper

    asHandle, toMinecraft, unwrap
  • Method Details

    • sound

      @AsOf("2.4.1") SoundEvent sound()
      Gets the sound of the music.
      Returns:
      the sound of the music
      Since:
      2.4.1
    • minDelay

      @AsOf("2.4.1") int minDelay()
      Gets the minimum delay of the music.
      Returns:
      the minimum delay of the music
      Since:
      2.4.1
    • maxDelay

      @AsOf("2.4.1") int maxDelay()
      Gets the maximum delay of the music.
      Returns:
      the maximum delay of the music
      Since:
      2.4.1
    • replaceCurrentMusic

      @AsOf("2.4.1") boolean replaceCurrentMusic()
      Gets whether the music should replace the current music.
      Returns:
      whether the music should replace the current music
      Since:
      2.4.1
    • toBuilder

      @AsOf("3.3.0") default Music.Builder toBuilder()
      Creates a new builder with the same values as this music.
      Returns:
      a new builder with the same values
      Since:
      3.3.0
    • of

      @AsOf("2.4.1") static Music of(SoundEvent sound, int minDelay, int maxDelay, boolean replaceCurrentMusic)
      Creates a new music record.
      Parameters:
      sound - the sound of the music
      minDelay - the minimum delay of the music
      maxDelay - the maximum delay of the music
      replaceCurrentMusic - whether the music should replace the current music
      Returns:
      a new music record
      Since:
      2.4.1
    • of

      @AsOf("3.0.1") static Music of(Sound bukkitSound, int minDelay, int maxDelay, boolean replaceCurrentMusic)
      Creates a new music record.
      Parameters:
      bukkitSound - the sound of the music
      minDelay - the minimum delay of the music
      maxDelay - the maximum delay of the music
      replaceCurrentMusic - whether the music should replace the current music
      Returns:
      a new music record
      Since:
      3.0.1
    • of

      @AsOf("3.1.0") static Music of(String soundKey, int minDelay, int maxDelay, boolean replaceCurrentMusic)
      Creates a new music record.
      Parameters:
      soundKey - the sound of the music
      minDelay - the minimum delay of the music
      maxDelay - the maximum delay of the music
      replaceCurrentMusic - whether the music should replace the current music
      Returns:
      a new music record
      Since:
      3.1.0
    • builder

      @AsOf("2.4.1") static Music.Builder builder()
      Creates a new music record builder.
      Returns:
      a new music record builder
      Since:
      2.4.1
    • decode

      @AsOf("3.3.0") static Music decode(Object minecraftMusic)
      Reads Minecraft music into a wrapper.
      Parameters:
      minecraftMusic - the music to read
      Returns:
      the wrapper for it
      Since:
      3.3.0