Interface SpellIngredient
public interface SpellIngredient
Represents a spell ingredient.
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionList<net.minecraft.world.item.ItemStack> booleancanCombine(SpellIngredient other) com.mojang.serialization.MapCodec<? extends SpellIngredient> codec()@Nullable SpellIngredientcombine(SpellIngredient other) booleanconsume(net.minecraft.world.level.Level level, net.minecraft.core.BlockPos pos) Attempts to consume the spell ingredient.intcount()List<net.minecraft.network.chat.Component> tooltip(@Nullable net.minecraft.world.level.Level level)
-
Field Details
-
CODEC
-
-
Method Details
-
codec
com.mojang.serialization.MapCodec<? extends SpellIngredient> codec()- Returns:
- The registered
MapCodecof the spell ingredient.
-
count
int count()- Returns:
- The count of the spell ingredient.
-
tooltip
- Parameters:
level- TheLevelthat the tooltip will be displayed in.- Returns:
- A list of tooltip
Components for the spell ingredient.
-
canCombine
- Parameters:
other- The other ingredient to combine with.- Returns:
- Whether the spell ingredient and the other spell ingredient can be combined.
- See Also:
-
combine
- Parameters:
other- The other ingredient to combine with.- Returns:
- The combination of the spell ingredient with the other spell ingredient, or null if they cannot be combined.
- See Also:
-
consume
boolean consume(net.minecraft.world.level.Level level, net.minecraft.core.BlockPos pos) Attempts to consume the spell ingredient.- Parameters:
level- TheLevelin which the spell ingredient is consumed.pos- TheBlockPosat which the spell ingredient is consumed.- Returns:
- Whether the spell ingredient was consumed or not.
-
asItemStacks
List<net.minecraft.world.item.ItemStack> asItemStacks()- Returns:
- A representation of the spell ingredients as item stacks, for use in GUI rendering.
-