Record Class TargetedConditionalEffect<T>
java.lang.Object
java.lang.Record
net.minecraft.world.item.enchantment.TargetedConditionalEffect<T>
public record TargetedConditionalEffect<T>(EnchantmentTarget enchanted, EnchantmentTarget affected, T effect, Optional<LootItemCondition> requirements)
extends Record
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final EnchantmentTargetThe field for theaffectedrecord component.private final TThe field for theeffectrecord component.private final EnchantmentTargetThe field for theenchantedrecord component.private final Optional<LootItemCondition> The field for therequirementsrecord component. -
Constructor Summary
ConstructorsConstructorDescriptionTargetedConditionalEffect(EnchantmentTarget enchanted, EnchantmentTarget affected, T effect, Optional<LootItemCondition> requirements) Creates an instance of aTargetedConditionalEffectrecord class. -
Method Summary
Modifier and TypeMethodDescriptionaffected()Returns the value of theaffectedrecord component.static <S> com.mojang.serialization.Codec<TargetedConditionalEffect<S>> codec(com.mojang.serialization.Codec<S> p_345149_, LootContextParamSet p_344121_) effect()Returns the value of theeffectrecord component.Returns the value of theenchantedrecord component.final booleanIndicates whether some other object is "equal to" this one.static <S> com.mojang.serialization.Codec<TargetedConditionalEffect<S>> equipmentDropsCodec(com.mojang.serialization.Codec<S> p_343050_, LootContextParamSet p_343380_) final inthashCode()Returns a hash code value for this object.booleanmatches(LootContext p_343867_) Returns the value of therequirementsrecord component.final StringtoString()Returns a string representation of this record class.
-
Field Details
-
enchanted
The field for theenchantedrecord component. -
affected
The field for theaffectedrecord component. -
effect
The field for theeffectrecord component. -
requirements
The field for therequirementsrecord component.
-
-
Constructor Details
-
TargetedConditionalEffect
public TargetedConditionalEffect(EnchantmentTarget enchanted, EnchantmentTarget affected, T effect, Optional<LootItemCondition> 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
-
codec
public static <S> com.mojang.serialization.Codec<TargetedConditionalEffect<S>> codec(com.mojang.serialization.Codec<S> p_345149_, LootContextParamSet p_344121_) -
equipmentDropsCodec
public static <S> com.mojang.serialization.Codec<TargetedConditionalEffect<S>> equipmentDropsCodec(com.mojang.serialization.Codec<S> p_343050_, LootContextParamSet p_343380_) -
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). -
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
-