Interface AnvilInventory

All Superinterfaces:
Inventory, Iterable<ItemStack>

public interface AnvilInventory extends Inventory
Interface to the inventory of an Anvil.
  • Method Details

    • getRenameText

      @Nullable String getRenameText()
      Get the name to be applied to the repaired item. An empty string denotes the default item name.
      Returns:
      the rename text
    • getRepairCostAmount

      int getRepairCostAmount()
      Get the item cost (in amount) to complete the current repair.
      Returns:
      the amount
    • setRepairCostAmount

      void setRepairCostAmount(int amount)
      Set the item cost (in amount) to complete the current repair.
      Parameters:
      amount - the amount
    • getRepairCost

      int getRepairCost()
      Get the experience cost (in levels) to complete the current repair.
      Returns:
      the experience cost
    • setRepairCost

      void setRepairCost(int levels)
      Set the experience cost (in levels) to complete the current repair.
      Parameters:
      levels - the experience cost
    • getMaximumRepairCost

      int getMaximumRepairCost()
      Get the maximum experience cost (in levels) to be allowed by the current repair. If the result of getRepairCost() exceeds the returned value, the repair result will be air to due being "too expensive".

      By default, this level is set to 40. Players in creative mode ignore the maximum repair cost.

      Returns:
      the maximum experience cost
    • setMaximumRepairCost

      void setMaximumRepairCost(int levels)
      Set the maximum experience cost (in levels) to be allowed by the current repair. The default value set by vanilla Minecraft is 40.
      Parameters:
      levels - the maximum experience cost