Record Class CustomBossEvent.Packed

java.lang.Object
java.lang.Record
net.minecraft.server.bossevents.CustomBossEvent.Packed
Enclosing class:
CustomBossEvent

public static record CustomBossEvent.Packed(Component name, boolean visible, int value, int max, BossEvent.BossBarColor color, BossEvent.BossBarOverlay overlay, boolean darkenScreen, boolean playBossMusic, boolean createWorldFog, Set<UUID> players) extends Record
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final com.mojang.serialization.Codec<CustomBossEvent.Packed>
     
    The field for the color record component.
    private final boolean
    The field for the createWorldFog record component.
    private final boolean
    The field for the darkenScreen record component.
    private final int
    The field for the max record component.
    private final Component
    The field for the name record component.
    The field for the overlay record component.
    private final boolean
    The field for the playBossMusic record component.
    private final Set<UUID>
    The field for the players record component.
    private final int
    The field for the value record component.
    private final boolean
    The field for the visible record component.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Packed(Component name, boolean visible, int value, int max, BossEvent.BossBarColor color, BossEvent.BossBarOverlay overlay, boolean darkenScreen, boolean playBossMusic, boolean createWorldFog, Set<UUID> players)
    Creates an instance of a Packed record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    Returns the value of the color record component.
    boolean
    Returns the value of the createWorldFog record component.
    boolean
    Returns the value of the darkenScreen record component.
    final boolean
    Indicates whether some other object is "equal to" this one.
    final int
    Returns a hash code value for this object.
    int
    max()
    Returns the value of the max record component.
    Returns the value of the name record component.
    Returns the value of the overlay record component.
    boolean
    Returns the value of the playBossMusic record component.
    Returns the value of the players record component.
    final String
    Returns a string representation of this record class.
    int
    Returns the value of the value record component.
    boolean
    Returns the value of the visible record component.

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Field Details

    • name

      private final Component name
      The field for the name record component.
    • visible

      private final boolean visible
      The field for the visible record component.
    • value

      private final int value
      The field for the value record component.
    • max

      private final int max
      The field for the max record component.
    • color

      private final BossEvent.BossBarColor color
      The field for the color record component.
    • overlay

      private final BossEvent.BossBarOverlay overlay
      The field for the overlay record component.
    • darkenScreen

      private final boolean darkenScreen
      The field for the darkenScreen record component.
    • playBossMusic

      private final boolean playBossMusic
      The field for the playBossMusic record component.
    • createWorldFog

      private final boolean createWorldFog
      The field for the createWorldFog record component.
    • players

      private final Set<UUID> players
      The field for the players record component.
    • CODEC

      public static final com.mojang.serialization.Codec<CustomBossEvent.Packed> CODEC
  • Constructor Details

    • Packed

      public Packed(Component name, boolean visible, int value, int max, BossEvent.BossBarColor color, BossEvent.BossBarOverlay overlay, boolean darkenScreen, boolean playBossMusic, boolean createWorldFog, Set<UUID> players)
      Creates an instance of a Packed record class.
      Parameters:
      name - the value for the name record component
      visible - the value for the visible record component
      value - the value for the value record component
      max - the value for the max record component
      color - the value for the color record component
      overlay - the value for the overlay record component
      darkenScreen - the value for the darkenScreen record component
      playBossMusic - the value for the playBossMusic record component
      createWorldFog - the value for the createWorldFog record component
      players - the value for the players record component
  • Method Details

    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared with Objects::equals(Object,Object); primitive components are compared with '=='.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • name

      public Component name()
      Returns the value of the name record component.
      Returns:
      the value of the name record component
    • visible

      public boolean visible()
      Returns the value of the visible record component.
      Returns:
      the value of the visible record component
    • value

      public int value()
      Returns the value of the value record component.
      Returns:
      the value of the value record component
    • max

      public int max()
      Returns the value of the max record component.
      Returns:
      the value of the max record component
    • color

      public BossEvent.BossBarColor color()
      Returns the value of the color record component.
      Returns:
      the value of the color record component
    • overlay

      public BossEvent.BossBarOverlay overlay()
      Returns the value of the overlay record component.
      Returns:
      the value of the overlay record component
    • darkenScreen

      public boolean darkenScreen()
      Returns the value of the darkenScreen record component.
      Returns:
      the value of the darkenScreen record component
    • playBossMusic

      public boolean playBossMusic()
      Returns the value of the playBossMusic record component.
      Returns:
      the value of the playBossMusic record component
    • createWorldFog

      public boolean createWorldFog()
      Returns the value of the createWorldFog record component.
      Returns:
      the value of the createWorldFog record component
    • players

      public Set<UUID> players()
      Returns the value of the players record component.
      Returns:
      the value of the players record component