Class XSound.Record

java.lang.Object
com.cryptomorin.xseries.XSound.Record
Enclosing class:
XSound

public static final class XSound.Record extends Object
A class to help caching and playing sound properties parsed from config.
Since:
3.0.0
  • Constructor Details

    • Record

      public Record()
  • Method Details

    • getSeed

      @Nullable public @Nullable Long getSeed()
    • std

      public Object std()
    • getCategory

      @NotNull public @NotNull XSound.Category getCategory()
    • getVolume

      public float getVolume()
    • getPitch

      public float getPitch()
    • inCategory

      public XSound.Record inCategory(XSound.Category category)
    • soundPlayer

      public XSound.SoundPlayer soundPlayer()
      Returns:
      a new XSound.SoundPlayer object.
    • withSound

      public XSound.Record withSound(@NotNull @NotNull XSound sound)
    • withSound

      public XSound.Record withSound(@NotNull @NotNull String sound)
      The sound including the namespace and the key. E.g. for XSound.ENTITY_PLAYER_HURT it'd be minecraft:entity_player_hurt you can use other namespaces instead of "minecraft" to use sounds from resource packs.
    • generateSeed

      public long generateSeed()
    • withVolume

      public XSound.Record withVolume(float volume)
    • publicSound

      public XSound.Record publicSound(boolean publicSound)
      Whether to play this sound to all nearby players or just the players specified in the XSound.SoundPlayer.players list.
    • withPitch

      public XSound.Record withPitch(float pitch)
    • withSeed

      public XSound.Record withSeed(Long seed)
      Some sounds have different variations. Using a static seed will always play the same variation for that sound.
      Parameters:
      seed - Randomizes the variation of null.
    • rebuild

      public String rebuild()
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • copy

      public XSound.Record copy()