Record Class TargetedConditionalEffect<E extends Enchantment.Effect>
java.lang.Object
java.lang.Record
net.minestom.server.item.enchant.TargetedConditionalEffect<E>
- All Implemented Interfaces:
Enchantment.Effect
public record TargetedConditionalEffect<E extends Enchantment.Effect>(Enchantment.Target enchanted, Enchantment.Target affected, E extends Enchantment.Effect effect, @Nullable DataPredicate requirements)
extends Record
implements Enchantment.Effect
-
Constructor Summary
ConstructorsConstructorDescriptionTargetedConditionalEffect(Enchantment.Target enchanted, Enchantment.Target affected, E effect, @Nullable DataPredicate requirements) Creates an instance of aTargetedConditionalEffectrecord class. -
Method Summary
Modifier and TypeMethodDescriptionaffected()Returns the value of theaffectedrecord component.effect()Returns the value of theeffectrecord component.Returns the value of theenchantedrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.static <E extends Enchantment.Effect>
Codec<TargetedConditionalEffect<E>> Returns the value of therequirementsrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
TargetedConditionalEffect
public TargetedConditionalEffect(Enchantment.Target enchanted, @Nullable Enchantment.Target affected, E effect, @Nullable @Nullable DataPredicate requirements) Creates an instance of aTargetedConditionalEffectrecord class.- Parameters:
enchanted- the value for theenchantedrecord componentaffected- the value for theaffectedrecord componenteffect- the value for theeffectrecord componentrequirements- the value for therequirementsrecord component
-
-
Method Details
-
nbtType
public static <E extends Enchantment.Effect> Codec<TargetedConditionalEffect<E>> nbtType(Codec<E> effectType) -
toString
-
hashCode
-
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). -
enchanted
Returns the value of theenchantedrecord component.- Returns:
- the value of the
enchantedrecord component
-
affected
Returns the value of theaffectedrecord component.- Returns:
- the value of the
affectedrecord component
-
effect
Returns the value of theeffectrecord component.- Returns:
- the value of the
effectrecord component
-
requirements
Returns the value of therequirementsrecord component.- Returns:
- the value of the
requirementsrecord component
-