Package net.minecraft.server.bossevents
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
FieldsModifier and TypeFieldDescriptionstatic final com.mojang.serialization.Codec
<CustomBossEvent.Packed> private final BossEvent.BossBarColor
The field for thecolor
record component.private final boolean
The field for thecreateWorldFog
record component.private final boolean
The field for thedarkenScreen
record component.private final int
The field for themax
record component.private final Component
The field for thename
record component.private final BossEvent.BossBarOverlay
The field for theoverlay
record component.private final boolean
The field for theplayBossMusic
record component.The field for theplayers
record component.private final int
The field for thevalue
record component.private final boolean
The field for thevisible
record component. -
Constructor Summary
ConstructorsConstructorDescriptionPacked
(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 aPacked
record class. -
Method Summary
Modifier and TypeMethodDescriptioncolor()
Returns the value of thecolor
record component.boolean
Returns the value of thecreateWorldFog
record component.boolean
Returns the value of thedarkenScreen
record component.final boolean
Indicates whether some other object is "equal to" this one.final int
hashCode()
Returns a hash code value for this object.int
max()
Returns the value of themax
record component.name()
Returns the value of thename
record component.overlay()
Returns the value of theoverlay
record component.boolean
Returns the value of theplayBossMusic
record component.players()
Returns the value of theplayers
record component.final String
toString()
Returns a string representation of this record class.int
value()
Returns the value of thevalue
record component.boolean
visible()
Returns the value of thevisible
record component.
-
Field Details
-
name
The field for thename
record component. -
visible
private final boolean visibleThe field for thevisible
record component. -
value
private final int valueThe field for thevalue
record component. -
max
private final int maxThe field for themax
record component. -
color
The field for thecolor
record component. -
overlay
The field for theoverlay
record component. -
darkenScreen
private final boolean darkenScreenThe field for thedarkenScreen
record component. -
playBossMusic
private final boolean playBossMusicThe field for theplayBossMusic
record component. -
createWorldFog
private final boolean createWorldFogThe field for thecreateWorldFog
record component. -
players
The field for theplayers
record component. -
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 aPacked
record class.- Parameters:
name
- the value for thename
record componentvisible
- the value for thevisible
record componentvalue
- the value for thevalue
record componentmax
- the value for themax
record componentcolor
- the value for thecolor
record componentoverlay
- the value for theoverlay
record componentdarkenScreen
- the value for thedarkenScreen
record componentplayBossMusic
- the value for theplayBossMusic
record componentcreateWorldFog
- the value for thecreateWorldFog
record componentplayers
- the value for theplayers
record component
-
-
Method Details
-
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. -
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. -
equals
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 withObjects::equals(Object,Object)
; primitive components are compared with '=='. -
name
Returns the value of thename
record component.- Returns:
- the value of the
name
record component
-
visible
public boolean visible()Returns the value of thevisible
record component.- Returns:
- the value of the
visible
record component
-
value
public int value()Returns the value of thevalue
record component.- Returns:
- the value of the
value
record component
-
max
public int max()Returns the value of themax
record component.- Returns:
- the value of the
max
record component
-
color
Returns the value of thecolor
record component.- Returns:
- the value of the
color
record component
-
overlay
Returns the value of theoverlay
record component.- Returns:
- the value of the
overlay
record component
-
darkenScreen
public boolean darkenScreen()Returns the value of thedarkenScreen
record component.- Returns:
- the value of the
darkenScreen
record component
-
playBossMusic
public boolean playBossMusic()Returns the value of theplayBossMusic
record component.- Returns:
- the value of the
playBossMusic
record component
-
createWorldFog
public boolean createWorldFog()Returns the value of thecreateWorldFog
record component.- Returns:
- the value of the
createWorldFog
record component
-
players
Returns the value of theplayers
record component.- Returns:
- the value of the
players
record component
-