Record Class MobEffectsPredicate
java.lang.Object
java.lang.Record
net.minecraft.advancements.critereon.MobEffectsPredicate
public record MobEffectsPredicate(Map<Holder<MobEffect>,MobEffectsPredicate.MobEffectInstancePredicate> effectMap)
extends Record
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
static final record
-
Field Summary
Modifier and TypeFieldDescriptionstatic final com.mojang.serialization.Codec<MobEffectsPredicate>
private final Map<Holder<MobEffect>,
MobEffectsPredicate.MobEffectInstancePredicate> The field for theeffectMap
record component. -
Constructor Summary
ConstructorDescriptionMobEffectsPredicate
(Map<Holder<MobEffect>, MobEffectsPredicate.MobEffectInstancePredicate> effectMap) Creates an instance of aMobEffectsPredicate
record class. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of theeffectMap
record component.final boolean
Indicates whether some other object is "equal to" this one.static Optional<MobEffectsPredicate>
fromJson
(com.google.gson.JsonElement p_56560_) final int
hashCode()
Returns a hash code value for this object.boolean
matches
(Map<MobEffect, MobEffectInstance> p_56562_) boolean
boolean
matches
(LivingEntity p_56558_) com.google.gson.JsonElement
final String
toString()
Returns a string representation of this record class.
-
Field Details
-
effectMap
The field for theeffectMap
record component. -
CODEC
-
-
Constructor Details
-
MobEffectsPredicate
public MobEffectsPredicate(Map<Holder<MobEffect>, MobEffectsPredicate.MobEffectInstancePredicate> effectMap) Creates an instance of aMobEffectsPredicate
record class.- Parameters:
effectMap
- the value for theeffectMap
record component
-
-
Method Details
-
matches
-
matches
-
matches
-
fromJson
public static Optional<MobEffectsPredicate> fromJson(@Nullable com.google.gson.JsonElement p_56560_) -
serializeToJson
public com.google.gson.JsonElement serializeToJson() -
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)
. -
effectMap
Returns the value of theeffectMap
record component.- Returns:
- the value of the
effectMap
record component
-