Class NBTIngredient
java.lang.Object
net.minecraft.world.item.crafting.Ingredient
net.neoforged.neoforge.common.crafting.NBTIngredient
Ingredient that matches the given items, performing either a 
strict or a partial NBT test.
 Strict NBT ingredients will only match items that have exactly the provided tag, while partial ones will match if the item's tags contain all of the elements of the provided one, while allowing for additional elements to exist.
- 
Nested Class Summary
Nested classes/interfaces inherited from class net.minecraft.world.item.crafting.Ingredient
Ingredient.ItemValue, Ingredient.TagValue, Ingredient.Value - 
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final com.mojang.serialization.Codec<NBTIngredient>static final com.mojang.serialization.Codec<NBTIngredient>private final booleanFields inherited from class net.minecraft.world.item.crafting.Ingredient
EMPTY, LIST_CODEC, LIST_CODEC_NONEMPTY, values, VANILLA_CODEC, VANILLA_CODEC_NONEMPTY - 
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedNBTIngredient(Set<Item> items, CompoundTag tag, boolean strict)  - 
Method Summary
Modifier and TypeMethodDescriptionprotected booleanareStacksEqual(ItemStack left, ItemStack right) private static booleancompareStacksWithNBT(ItemStack left, ItemStack right) getTag()booleanisSimple()booleanisStrict()static NBTIngredientof(boolean strict, CompoundTag nbt, ItemLike... items) Creates a new ingredient matching any item from the list, containing the given NBTstatic NBTIngredientCreates a new ingredient matching the given item, containing the given NBTbooleanReturns iftrue, this ingredient will be synchronized using its contents, as in vanilla, otherwise it will be synchronized via thecodec.Methods inherited from class net.minecraft.world.item.crafting.Ingredient
equals, fromJson, fromNetwork, fromValues, getItems, getStackingIds, getType, getValues, isEmpty, of, of, of, of, of, test, toNetwork 
- 
Field Details
- 
CODEC
 - 
CODEC_NONEMPTY
 - 
strict
private final boolean strict 
 - 
 - 
Constructor Details
- 
NBTIngredient
 
 - 
 - 
Method Details
- 
areStacksEqual
- Overrides:
 areStacksEqualin classIngredient
 - 
synchronizeWithContents
public boolean synchronizeWithContents()Description copied from class:IngredientReturns iftrue, this ingredient will be synchronized using its contents, as in vanilla, otherwise it will be synchronized via thecodec.- Overrides:
 synchronizeWithContentsin classIngredient- Returns:
 - if 
true, this ingredient will be synchronized using its contents, as in vanilla, otherwise it will be synchronized via thecodec 
 - 
compareStacksWithNBT
 - 
of
Creates a new ingredient matching any item from the list, containing the given NBT - 
of
Creates a new ingredient matching the given item, containing the given NBT - 
getContainedItems
 - 
getTag
 - 
isSimple
public boolean isSimple()- Overrides:
 isSimplein classIngredient
 - 
isStrict
public boolean isStrict() 
 -