Class EffectIngredient
java.lang.Object
org.moddingx.libx.crafting.ingredient.EffectIngredient
- All Implemented Interfaces:
net.neoforged.neoforge.common.crafting.ICustomIngredient
public class EffectIngredient
extends Object
implements net.neoforged.neoforge.common.crafting.ICustomIngredient
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.-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final com.mojang.serialization.MapCodec
<EffectIngredient> final 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.static final net.minecraft.network.codec.StreamCodec
<net.minecraft.network.RegistryFriendlyByteBuf, EffectIngredient> static final net.neoforged.neoforge.common.crafting.IngredientType
<EffectIngredient> -
Constructor Summary
ConstructorsConstructorDescriptionEffectIngredient
(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 java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface net.neoforged.neoforge.common.crafting.ICustomIngredient
toVanilla
-
Field Details
-
CODEC
-
STREAM_CODEC
public static final net.minecraft.network.codec.StreamCodec<net.minecraft.network.RegistryFriendlyByteBuf,EffectIngredient> STREAM_CODEC -
TYPE
-
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
-
getType
- Specified by:
getType
in interfacenet.neoforged.neoforge.common.crafting.ICustomIngredient
-
getItems
- Specified by:
getItems
in interfacenet.neoforged.neoforge.common.crafting.ICustomIngredient
-
test
- Specified by:
test
in interfacenet.neoforged.neoforge.common.crafting.ICustomIngredient
-
isSimple
public boolean isSimple()- Specified by:
isSimple
in interfacenet.neoforged.neoforge.common.crafting.ICustomIngredient
-