Interface IAnvilRecipe


  • public interface IAnvilRecipe
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      int getID()  
      java.lang.String getName()
      Returns the unique name of this anvil recipe.
      float getRepairPercentage()
      The repair percentage (e.g., 0.1f repairs 10% of max damage per tick).
      net.minecraft.item.ItemStack getResult​(net.minecraft.item.ItemStack itemToRepair)
      Returns the repaired item based on the input damaged item.
      int getXpCost()
      The XP cost per repair tick (e.g., 10 levels per tick).
      boolean matches​(net.minecraft.item.ItemStack itemToRepair, net.minecraft.item.ItemStack repairMaterial)
      Checks whether the provided item and repair material match this recipe.
    • Method Detail

      • getName

        java.lang.String getName()
        Returns the unique name of this anvil recipe.
      • getXpCost

        int getXpCost()
        The XP cost per repair tick (e.g., 10 levels per tick).
      • getRepairPercentage

        float getRepairPercentage()
        The repair percentage (e.g., 0.1f repairs 10% of max damage per tick).
      • matches

        boolean matches​(net.minecraft.item.ItemStack itemToRepair,
                        net.minecraft.item.ItemStack repairMaterial)
        Checks whether the provided item and repair material match this recipe.
        Parameters:
        itemToRepair - the damaged item
        repairMaterial - the material used to repair
        Returns:
        true if the items match the recipe requirements
      • getResult

        net.minecraft.item.ItemStack getResult​(net.minecraft.item.ItemStack itemToRepair)
        Returns the repaired item based on the input damaged item.
        Parameters:
        itemToRepair - the input damaged item
        Returns:
        a copy with reduced damage
      • getID

        int getID()