Interface ISpellIngredient
public interface ISpellIngredient
Interface representing an ingredient for spell crafting.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final com.mojang.serialization.Codec<ISpellIngredient>static final com.mojang.serialization.Codec<ISpellIngredient> -
Method Summary
Modifier and TypeMethodDescriptionbooleancanCombine(ISpellIngredient other) @Nullable ISpellIngredientcombine(ISpellIngredient other) @Nullable ISpellIngredientconsume(net.minecraft.world.level.Level level, net.minecraft.core.BlockPos pos) Consumes this ingredient.intgetCount()List<net.minecraft.network.chat.Component>SpellIngredientType<? extends ISpellIngredient>getType()
-
Field Details
-
CODEC
-
NETWORK_CODEC
-
-
Method Details
-
getType
SpellIngredientType<? extends ISpellIngredient> getType()- Returns:
- The id of this type.
-
getCount
int getCount()- Returns:
- The count of this type.
-
getTooltip
List<net.minecraft.network.chat.Component> getTooltip()- Returns:
- The tooltip of this type.
-
canCombine
- Parameters:
other- The other ingredient to check.- Returns:
- If this ingredient can combine with the other given ingredient.
-
combine
- Parameters:
other- The other ingredient to combine this one with.- Returns:
- This ingredient, combined with the other one.
-
consume
@Nullable @Nullable ISpellIngredient consume(net.minecraft.world.level.Level level, net.minecraft.core.BlockPos pos) Consumes this ingredient.- Parameters:
level- The level in which this ingredient is consumed.pos- The position at which this ingredient is consumed.- Returns:
- The leftover of the consumption.
-