Record Class EnchantmentPredicate
java.lang.Object
java.lang.Record
net.minecraft.advancements.critereon.EnchantmentPredicate
public record EnchantmentPredicate(Optional<Holder<Enchantment>> enchantment, MinMaxBounds.Ints level)
extends Record
- 
Field SummaryFieldsModifier and TypeFieldDescriptionstatic final com.mojang.serialization.Codec<EnchantmentPredicate>private final Optional<Holder<Enchantment>>The field for theenchantmentrecord component.private final MinMaxBounds.IntsThe field for thelevelrecord component.
- 
Constructor SummaryConstructorsConstructorDescriptionEnchantmentPredicate(Optional<Holder<Enchantment>> enchantment, MinMaxBounds.Ints level) Creates an instance of aEnchantmentPredicaterecord class.EnchantmentPredicate(Enchantment p_30471_, MinMaxBounds.Ints p_30472_) 
- 
Method SummaryModifier and TypeMethodDescriptionbooleancontainedIn(Map<Enchantment, Integer> p_30477_) Returns the value of theenchantmentrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.level()Returns the value of thelevelrecord component.final StringtoString()Returns a string representation of this record class.
- 
Field Details- 
enchantmentThe field for theenchantmentrecord component.
- 
levelThe field for thelevelrecord component.
- 
CODEC
 
- 
- 
Constructor Details- 
EnchantmentPredicate
- 
EnchantmentPredicateCreates an instance of aEnchantmentPredicaterecord class.- Parameters:
- enchantment- the value for the- enchantmentrecord component
- level- the value for the- levelrecord component
 
 
- 
- 
Method Details- 
containedIn
- 
toStringReturns 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.
- 
hashCodepublic 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.
- 
equalsIndicates 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).
- 
enchantmentReturns the value of theenchantmentrecord component.- Returns:
- the value of the enchantmentrecord component
 
- 
levelReturns the value of thelevelrecord component.- Returns:
- the value of the levelrecord component
 
 
-