Record Class MobEffectsPredicate.MobEffectInstancePredicate
java.lang.Object
java.lang.Record
net.minecraft.advancements.critereon.MobEffectsPredicate.MobEffectInstancePredicate
- Enclosing class:
- MobEffectsPredicate
public static record MobEffectsPredicate.MobEffectInstancePredicate(MinMaxBounds.Ints amplifier, MinMaxBounds.Ints duration, Optional<Boolean> ambient, Optional<Boolean> visible)
extends Record
-
Field Summary
Modifier and TypeFieldDescriptionThe field for theambient
record component.private final MinMaxBounds.Ints
The field for theamplifier
record component.static final com.mojang.serialization.Codec<MobEffectsPredicate.MobEffectInstancePredicate>
private final MinMaxBounds.Ints
The field for theduration
record component.The field for thevisible
record component. -
Constructor Summary
ConstructorDescriptionMobEffectInstancePredicate
(MinMaxBounds.Ints amplifier, MinMaxBounds.Ints duration, Optional<Boolean> ambient, Optional<Boolean> visible) Creates an instance of aMobEffectInstancePredicate
record class. -
Method Summary
Modifier and TypeMethodDescriptionambient()
Returns the value of theambient
record component.Returns the value of theamplifier
record component.duration()
Returns the value of theduration
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.boolean
matches
(MobEffectInstance p_56578_) final String
toString()
Returns a string representation of this record class.visible()
Returns the value of thevisible
record component.
-
Field Details
-
amplifier
The field for theamplifier
record component. -
duration
The field for theduration
record component. -
ambient
The field for theambient
record component. -
visible
The field for thevisible
record component. -
CODEC
public static final com.mojang.serialization.Codec<MobEffectsPredicate.MobEffectInstancePredicate> CODEC
-
-
Constructor Details
-
MobEffectInstancePredicate
public MobEffectInstancePredicate() -
MobEffectInstancePredicate
public MobEffectInstancePredicate(MinMaxBounds.Ints amplifier, MinMaxBounds.Ints duration, Optional<Boolean> ambient, Optional<Boolean> visible) Creates an instance of aMobEffectInstancePredicate
record class.- Parameters:
amplifier
- the value for theamplifier
record componentduration
- the value for theduration
record componentambient
- the value for theambient
record componentvisible
- the value for thevisible
record component
-
-
Method Details
-
matches
-
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. All components in this record class are compared withObjects::equals(Object,Object)
. -
amplifier
Returns the value of theamplifier
record component.- Returns:
- the value of the
amplifier
record component
-
duration
Returns the value of theduration
record component.- Returns:
- the value of the
duration
record component
-
ambient
Returns the value of theambient
record component.- Returns:
- the value of the
ambient
record component
-
visible
Returns the value of thevisible
record component.- Returns:
- the value of the
visible
record component
-