Package net.minestom.server.item.enchant
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 aTargetedConditionalEffect
record class. -
Method Summary
Modifier and TypeMethodDescriptionaffected()
Returns the value of theaffected
record component.effect()
Returns the value of theeffect
record component.Returns the value of theenchanted
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.static <E extends Enchantment.Effect>
@NotNull BinaryTagSerializer<TargetedConditionalEffect<E>> nbtType
(@NotNull BinaryTagSerializer<E> effectType) @Nullable DataPredicate
Returns the value of therequirements
record component.final String
toString()
Returns a string representation of this record class.
-
Constructor Details
-
TargetedConditionalEffect
public TargetedConditionalEffect(@NotNull Enchantment.Target enchanted, @Nullable Enchantment.Target affected, @NotNull E effect, @Nullable @Nullable DataPredicate requirements) Creates an instance of aTargetedConditionalEffect
record class.- Parameters:
enchanted
- the value for theenchanted
record componentaffected
- the value for theaffected
record componenteffect
- the value for theeffect
record componentrequirements
- the value for therequirements
record component
-
-
Method Details
-
nbtType
@NotNull public static <E extends Enchantment.Effect> @NotNull BinaryTagSerializer<TargetedConditionalEffect<E>> nbtType(@NotNull @NotNull BinaryTagSerializer<E> effectType) -
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)
. -
enchanted
Returns the value of theenchanted
record component.- Returns:
- the value of the
enchanted
record component
-
affected
Returns the value of theaffected
record component.- Returns:
- the value of the
affected
record component
-
effect
Returns the value of theeffect
record component.- Returns:
- the value of the
effect
record component
-
requirements
Returns the value of therequirements
record component.- Returns:
- the value of the
requirements
record component
-