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.

    Nested classes/interfaces inherited from interface Wrapper

    Wrapper.Context<C>
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    Creates a new music record builder.
    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.
    boolean
    Gets whether the music should replace the current music.
    Gets the sound of the music.

    Methods inherited from interface Wrapper

    asHandle, toMinecraft
  • Field Details

  • 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
    • 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
    • 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