Interface SpellIngredient


public interface SpellIngredient
Represents a spell ingredient.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final com.mojang.serialization.Codec<SpellIngredient>
     
  • Method Summary

    Modifier and Type
    Method
    Description
    List<net.minecraft.world.item.ItemStack>
     
    boolean
     
    com.mojang.serialization.MapCodec<? extends SpellIngredient>
     
    @Nullable SpellIngredient
     
    boolean
    consume(net.minecraft.world.level.Level level, net.minecraft.core.BlockPos pos)
    Attempts to consume the spell ingredient.
    int
     
    List<net.minecraft.network.chat.Component>
    tooltip(@Nullable net.minecraft.world.level.Level level)
     
  • Field Details

    • CODEC

      static final com.mojang.serialization.Codec<SpellIngredient> CODEC
  • Method Details

    • codec

      com.mojang.serialization.MapCodec<? extends SpellIngredient> codec()
      Returns:
      The registered MapCodec of the spell ingredient.
    • count

      int count()
      Returns:
      The count of the spell ingredient.
    • tooltip

      List<net.minecraft.network.chat.Component> tooltip(@Nullable net.minecraft.world.level.Level level)
      Parameters:
      level - The Level that the tooltip will be displayed in.
      Returns:
      A list of tooltip Components for the spell ingredient.
    • canCombine

      boolean canCombine(SpellIngredient other)
      Parameters:
      other - The other ingredient to combine with.
      Returns:
      Whether the spell ingredient and the other spell ingredient can be combined.
      See Also:
    • combine

      @Nullable SpellIngredient combine(SpellIngredient other)
      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 - The Level in which the spell ingredient is consumed.
      pos - The BlockPos at 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.