Interface AnvilInventory

All Superinterfaces:
Inventory, Iterable<ItemStack>

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

    • getRenameText Link icon

      @Deprecated(forRemoval=true, since="1.21") @Nullable @Nullable String getRenameText()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Get the name to be applied to the repaired item. An empty string denotes the default item name.
      Returns:
      the rename text
    • getRepairCostAmount Link icon

      @Deprecated(forRemoval=true, since="1.21") int getRepairCostAmount()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Get the item cost (in amount) to complete the current repair.
      Returns:
      the amount
    • setRepairCostAmount Link icon

      @Deprecated(forRemoval=true, since="1.21") void setRepairCostAmount(int amount)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Set the item cost (in amount) to complete the current repair.
      Parameters:
      amount - the amount
    • getRepairCost Link icon

      @Deprecated(forRemoval=true, since="1.21") int getRepairCost()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Get the experience cost (in levels) to complete the current repair.
      Returns:
      the experience cost
    • setRepairCost Link icon

      @Deprecated(forRemoval=true, since="1.21") void setRepairCost(int levels)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Set the experience cost (in levels) to complete the current repair.
      Parameters:
      levels - the experience cost
    • getMaximumRepairCost Link icon

      @Deprecated(forRemoval=true, since="1.21") int getMaximumRepairCost()
      Deprecated, for removal: This API element is subject to removal in a future version.
      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 Link icon

      @Deprecated(forRemoval=true, since="1.21") void setMaximumRepairCost(int levels)
      Deprecated, for removal: This API element is subject to removal in a future version.
      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
    • getFirstItem Link icon

      @Nullable default @Nullable ItemStack getFirstItem()
      Gets the item in the left input slot.
      Returns:
      item in the first slot
    • setFirstItem Link icon

      default void setFirstItem(@Nullable @Nullable ItemStack firstItem)
      Sets the item in the left input slot.
      Parameters:
      firstItem - item to set
    • getSecondItem Link icon

      @Nullable default @Nullable ItemStack getSecondItem()
      Gets the item in the right input slot.
      Returns:
      item in the second slot
    • setSecondItem Link icon

      default void setSecondItem(@Nullable @Nullable ItemStack secondItem)
      Sets the item in the right input slot.
      Parameters:
      secondItem - item to set
    • getResult Link icon

      @Nullable default @Nullable ItemStack getResult()
      Gets the item in the result slot.
      Returns:
      item in the result slot
    • setResult Link icon

      default void setResult(@Nullable @Nullable ItemStack result)
      Sets the item in the result slot. Note that the client might not be able to take out the item if it does not match the input items.
      Parameters:
      result - item to set