Package net.minecraft.predicate.item
Record Class ItemPredicate
java.lang.Object
java.lang.Record
net.minecraft.predicate.item.ItemPredicate
- Record Components:
tag-items-count-durability-enchantments-storedEnchantments-potion-nbt-
public record ItemPredicate(Optional<TagKey<Item>> tag, Optional<RegistryEntryList<Item>> items, NumberRange.IntRange count, NumberRange.IntRange durability, List<EnchantmentPredicate> enchantments, List<EnchantmentPredicate> storedEnchantments, Optional<RegistryEntry<Potion>> potion, Optional<NbtPredicate> nbt)
extends Record
- Mappings:
Namespace Name official caintermediary net/minecraft/class_2073named net/minecraft/predicate/item/ItemPredicateofficial bintermediary comp_1783named tagofficial cintermediary comp_1784named itemsofficial dintermediary comp_1785named countofficial eintermediary comp_1786named durabilityofficial fintermediary comp_1787named enchantmentsofficial gintermediary comp_1788named storedEnchantmentsofficial hintermediary comp_1789named potionofficial iintermediary comp_1790named nbt
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final com.mojang.serialization.Codec<ItemPredicate>private final NumberRange.IntRangeThe field for thecountrecord component.private final NumberRange.IntRangeThe field for thedurabilityrecord component.private final List<EnchantmentPredicate>The field for theenchantmentsrecord component.private static final com.mojang.serialization.Codec<RegistryEntryList<Item>>private final Optional<RegistryEntryList<Item>>The field for theitemsrecord component.private final Optional<NbtPredicate>The field for thenbtrecord component.private final Optional<RegistryEntry<Potion>>The field for thepotionrecord component.private final List<EnchantmentPredicate>The field for thestoredEnchantmentsrecord component.The field for thetagrecord component. -
Constructor Summary
ConstructorsConstructorDescriptionItemPredicate(Optional<TagKey<Item>> optional, Optional<RegistryEntryList<Item>> optional2, NumberRange.IntRange count, NumberRange.IntRange durability, List<EnchantmentPredicate> list, List<EnchantmentPredicate> list2, Optional<RegistryEntry<Potion>> optional3, Optional<NbtPredicate> optional4) -
Method Summary
Modifier and TypeMethodDescriptioncount()Returns the value of thecountrecord 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.nbt()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.booleanfinal StringtoString()Returns a string representation of this record class.
-
Field Details
-
tag
The field for thetagrecord component. -
items
The field for theitemsrecord component. -
count
The field for thecountrecord component. -
durability
The field for thedurabilityrecord component. -
enchantments
The field for theenchantmentsrecord component. -
storedEnchantments
The field for thestoredEnchantmentsrecord component. -
potion
The field for thepotionrecord component. -
nbt
The field for thenbtrecord component. -
ITEM_ENTRY_LIST_CODEC
- Mappings:
Namespace Name Mixin selector official jLca;j:Lcom/mojang/serialization/Codec;intermediary field_45755Lnet/minecraft/class_2073;field_45755:Lcom/mojang/serialization/Codec;named ITEM_ENTRY_LIST_CODECLnet/minecraft/predicate/item/ItemPredicate;ITEM_ENTRY_LIST_CODEC:Lcom/mojang/serialization/Codec;
-
CODEC
- Mappings:
Namespace Name Mixin selector official aLca;a:Lcom/mojang/serialization/Codec;intermediary field_45754Lnet/minecraft/class_2073;field_45754:Lcom/mojang/serialization/Codec;named CODECLnet/minecraft/predicate/item/ItemPredicate;CODEC:Lcom/mojang/serialization/Codec;
-
-
Constructor Details
-
ItemPredicate
public ItemPredicate(Optional<TagKey<Item>> optional, Optional<RegistryEntryList<Item>> optional2, NumberRange.IntRange count, NumberRange.IntRange durability, List<EnchantmentPredicate> list, List<EnchantmentPredicate> list2, Optional<RegistryEntry<Potion>> optional3, Optional<NbtPredicate> optional4) - Mappings:
Namespace Name Mixin selector official <init>Lca;<init>(Ljava/util/Optional;Ljava/util/Optional;Lck$d;Lck$d;Ljava/util/List;Ljava/util/List;Ljava/util/Optional;Ljava/util/Optional;)Vintermediary <init>Lnet/minecraft/class_2073;<init>(Ljava/util/Optional;Ljava/util/Optional;Lnet/minecraft/class_2096$class_2100;Lnet/minecraft/class_2096$class_2100;Ljava/util/List;Ljava/util/List;Ljava/util/Optional;Ljava/util/Optional;)Vnamed <init>Lnet/minecraft/predicate/item/ItemPredicate;<init>(Ljava/util/Optional;Ljava/util/Optional;Lnet/minecraft/predicate/NumberRange$IntRange;Lnet/minecraft/predicate/NumberRange$IntRange;Ljava/util/List;Ljava/util/List;Ljava/util/Optional;Ljava/util/Optional;)V
-
-
Method Details
-
test
- Mappings:
Namespace Name Mixin selector official aLca;a(Lcmy;)Zintermediary method_8970Lnet/minecraft/class_2073;method_8970(Lnet/minecraft/class_1799;)Znamed testLnet/minecraft/predicate/item/ItemPredicate;test(Lnet/minecraft/item/ItemStack;)Z
-
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). -
tag
Returns the value of thetagrecord component.- Returns:
- the value of the
tagrecord component
-
items
Returns the value of theitemsrecord component.- Returns:
- the value of the
itemsrecord component
-
count
Returns the value of thecountrecord component.- Returns:
- the value of the
countrecord component
-
durability
Returns the value of thedurabilityrecord component.- Returns:
- the value of the
durabilityrecord component
-
enchantments
Returns the value of theenchantmentsrecord component.- Returns:
- the value of the
enchantmentsrecord component
-
storedEnchantments
Returns the value of thestoredEnchantmentsrecord component.- Returns:
- the value of the
storedEnchantmentsrecord component
-
potion
Returns the value of thepotionrecord component.- Returns:
- the value of the
potionrecord component
-
nbt
Returns the value of thenbtrecord component.- Returns:
- the value of the
nbtrecord component
-