Record Class ItemPredicate
java.lang.Object
java.lang.Record
net.minecraft.advancements.critereon.ItemPredicate
public record ItemPredicate(Optional<TagKey<Item>> tag, Optional<HolderSet<Item>> items, MinMaxBounds.Ints count, MinMaxBounds.Ints durability, List<EnchantmentPredicate> enchantments, List<EnchantmentPredicate> storedEnchantments, Optional<Holder<Potion>> potion, Optional<NbtPredicate> nbt, Optional<ICustomItemPredicate> customLogic)
extends Record
- 
Nested Class SummaryNested Classes
- 
Field SummaryFieldsModifier and TypeFieldDescriptionstatic com.mojang.serialization.Codec<ItemPredicate>private final MinMaxBounds.IntsThe field for thecountrecord component.private final Optional<ICustomItemPredicate>The field for thecustomLogicrecord component.private final MinMaxBounds.IntsThe field for thedurabilityrecord component.private final List<EnchantmentPredicate>The field for theenchantmentsrecord component.The field for theitemsrecord component.private final Optional<NbtPredicate>The field for thenbtrecord component.The field for thepotionrecord component.private final List<EnchantmentPredicate>The field for thestoredEnchantmentsrecord component.The field for thetagrecord component.static final com.mojang.serialization.Codec<ItemPredicate>
- 
Constructor SummaryConstructorsConstructorDescriptionItemPredicate(Optional<TagKey<Item>> tag, Optional<HolderSet<Item>> items, MinMaxBounds.Ints count, MinMaxBounds.Ints durability, List<EnchantmentPredicate> enchantments, List<EnchantmentPredicate> storedEnchantments, Optional<Holder<Potion>> potion, Optional<NbtPredicate> nbt) ItemPredicate(Optional<TagKey<Item>> tag, Optional<HolderSet<Item>> items, MinMaxBounds.Ints count, MinMaxBounds.Ints durability, List<EnchantmentPredicate> enchantments, List<EnchantmentPredicate> storedEnchantments, Optional<Holder<Potion>> potion, Optional<NbtPredicate> nbt, Optional<ICustomItemPredicate> customLogic) Creates an instance of aItemPredicaterecord class.ItemPredicate(ICustomItemPredicate customLogic) 
- 
Method SummaryModifier and TypeMethodDescriptioncount()Returns the value of thecountrecord component.Returns the value of thecustomLogicrecord component.Returns the value of thedurabilityrecord component.Returns the value of theenchantmentsrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.items()Returns the value of theitemsrecord component.booleannbt()Returns the value of thenbtrecord component.potion()Returns the value of thepotionrecord component.Returns the value of thestoredEnchantmentsrecord component.tag()Returns the value of thetagrecord component.final StringtoString()Returns a string representation of this record class.
- 
Field Details- 
tagThe field for thetagrecord component.
- 
itemsThe field for theitemsrecord component.
- 
countThe field for thecountrecord component.
- 
durabilityThe field for thedurabilityrecord component.
- 
enchantmentsThe field for theenchantmentsrecord component.
- 
storedEnchantmentsThe field for thestoredEnchantmentsrecord component.
- 
potionThe field for thepotionrecord component.
- 
nbtThe field for thenbtrecord component.
- 
customLogicThe field for thecustomLogicrecord component.
- 
ITEMS_CODEC
- 
VANILLA_CODEC
- 
CODEC
 
- 
- 
Constructor Details- 
ItemPredicatepublic ItemPredicate(Optional<TagKey<Item>> tag, Optional<HolderSet<Item>> items, MinMaxBounds.Ints count, MinMaxBounds.Ints durability, List<EnchantmentPredicate> enchantments, List<EnchantmentPredicate> storedEnchantments, Optional<Holder<Potion>> potion, Optional<NbtPredicate> nbt) 
- 
ItemPredicate
- 
ItemPredicatepublic ItemPredicate(Optional<TagKey<Item>> tag, Optional<HolderSet<Item>> items, MinMaxBounds.Ints count, MinMaxBounds.Ints durability, List<EnchantmentPredicate> enchantments, List<EnchantmentPredicate> storedEnchantments, Optional<Holder<Potion>> potion, Optional<NbtPredicate> nbt, Optional<ICustomItemPredicate> customLogic) Creates an instance of aItemPredicaterecord class.- Parameters:
- tag- the value for the- tagrecord component
- items- the value for the- itemsrecord component
- count- the value for the- countrecord component
- durability- the value for the- durabilityrecord component
- enchantments- the value for the- enchantmentsrecord component
- storedEnchantments- the value for the- storedEnchantmentsrecord component
- potion- the value for the- potionrecord component
- nbt- the value for the- nbtrecord component
- customLogic- the value for the- customLogicrecord component
 
 
- 
- 
Method Details- 
matches
- 
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).
- 
tagReturns the value of thetagrecord component.- Returns:
- the value of the tagrecord component
 
- 
itemsReturns the value of theitemsrecord component.- Returns:
- the value of the itemsrecord component
 
- 
countReturns the value of thecountrecord component.- Returns:
- the value of the countrecord component
 
- 
durabilityReturns the value of thedurabilityrecord component.- Returns:
- the value of the durabilityrecord component
 
- 
enchantmentsReturns the value of theenchantmentsrecord component.- Returns:
- the value of the enchantmentsrecord component
 
- 
storedEnchantmentsReturns the value of thestoredEnchantmentsrecord component.- Returns:
- the value of the storedEnchantmentsrecord component
 
- 
potionReturns the value of thepotionrecord component.- Returns:
- the value of the potionrecord component
 
- 
nbtReturns the value of thenbtrecord component.- Returns:
- the value of the nbtrecord component
 
- 
customLogicReturns the value of thecustomLogicrecord component.- Returns:
- the value of the customLogicrecord component
 
 
-