Class EffectIngredient
java.lang.Object
net.minecraft.world.item.crafting.Ingredient
org.moddingx.libx.crafting.ingredient.EffectIngredient
- All Implemented Interfaces:
Predicate<net.minecraft.world.item.ItemStack>
public class EffectIngredient
extends net.minecraft.world.item.crafting.Ingredient
An ingredient that checks for
potion effects
to be present on a potion. This does
not check for a potion
but for the effects. So potions with the CustomPotionEffects
nbt
tag will also be detected. And you can match a for example a potion of the turtle master and a potion of
slowness as both have the slowness effect.-
Nested Class Summary
Nested classes/interfaces inherited from class net.minecraft.world.item.crafting.Ingredient
net.minecraft.world.item.crafting.Ingredient.ItemValue, net.minecraft.world.item.crafting.Ingredient.TagValue, net.minecraft.world.item.crafting.Ingredient.Value
-
Field Summary
Modifier and TypeFieldDescriptionfinal List<net.minecraft.world.effect.MobEffectInstance>
A list of effects that an ItemStack needs.final boolean
Whether potions with more effects than the ones specified in this ingredient are matched.final boolean
Whether potions with a higher amplifier as specified in this ingredient are matched.final boolean
Whether potions with a higher duration as specified in this ingredient are matched.final net.minecraft.world.item.Item
The item required for the potion.Fields inherited from class net.minecraft.world.item.crafting.Ingredient
EMPTY, values
-
Constructor Summary
ConstructorDescriptionEffectIngredient
(net.minecraft.world.item.Item potionItem, List<net.minecraft.world.effect.MobEffectInstance> effects) EffectIngredient
(net.minecraft.world.item.Item potionItem, List<net.minecraft.world.effect.MobEffectInstance> effects, boolean extraEffects, boolean higherAmplifier, boolean higherDuration) EffectIngredient
(net.minecraft.world.item.ItemStack potionStack) EffectIngredient
(net.minecraft.world.item.ItemStack potionStack, boolean extraEffects, boolean higherAmplifier, boolean higherDuration) -
Method Summary
Methods inherited from class net.minecraft.world.item.crafting.Ingredient
checkInvalidation, fromJson, fromJson, fromNetwork, fromValues, invalidate, invalidateAll, isVanilla, markValid, merge, of, of, of, of, of, toNetwork, valueFromJson
-
Field Details
-
potionItem
The item required for the potion. Can be null t match any item. -
effects
A list of effects that an ItemStack needs. -
extraEffects
public final boolean extraEffectsWhether potions with more effects than the ones specified in this ingredient are matched. -
higherAmplifier
public final boolean higherAmplifierWhether potions with a higher amplifier as specified in this ingredient are matched. -
higherDuration
public final boolean higherDurationWhether potions with a higher duration as specified in this ingredient are matched.
-
-
Constructor Details
-
EffectIngredient
public EffectIngredient(net.minecraft.world.item.ItemStack potionStack) -
EffectIngredient
public EffectIngredient(net.minecraft.world.item.ItemStack potionStack, boolean extraEffects, boolean higherAmplifier, boolean higherDuration) -
EffectIngredient
-
EffectIngredient
-
-
Method Details
-
getItems
- Overrides:
getItems
in classnet.minecraft.world.item.crafting.Ingredient
-
test
-
getStackingIds
- Overrides:
getStackingIds
in classnet.minecraft.world.item.crafting.Ingredient
-
isSimple
public boolean isSimple()- Overrides:
isSimple
in classnet.minecraft.world.item.crafting.Ingredient
-
getSerializer
@Nonnull public net.minecraftforge.common.crafting.IIngredientSerializer<? extends net.minecraft.world.item.crafting.Ingredient> getSerializer()- Overrides:
getSerializer
in classnet.minecraft.world.item.crafting.Ingredient
-
isEmpty
public boolean isEmpty()- Overrides:
isEmpty
in classnet.minecraft.world.item.crafting.Ingredient
-
toJson
- Overrides:
toJson
in classnet.minecraft.world.item.crafting.Ingredient
-