Interface EnchantmentView

All Superinterfaces:
InventoryView

public interface EnchantmentView extends InventoryView
An instance of InventoryView which provides extra methods related to enchantment table view data.
Since:
1.21
  • Method Details

    • getTopInventory

      Description copied from interface: InventoryView
      Get the upper inventory involved in this transaction.
      Specified by:
      getTopInventory in interface InventoryView
      Returns:
      the inventory
      Since:
      1.21.1
    • getEnchantmentSeed

      int getEnchantmentSeed()
      Gets the random enchantment seed used in this view
      Returns:
      The random seed used
      Since:
      1.21
    • setEnchantmentSeed

      void setEnchantmentSeed(int seed)
      Sets the random enchantment seed used in this view. Loses its effect once the view is closed.
      Parameters:
      seed - the random seed to use
      Since:
      1.21.1
    • getOffers

      Gets the offers of this EnchantmentView
      Returns:
      The enchantment offers that are provided
      Since:
      1.21
    • setOffers

      void setOffers(@Nullable EnchantmentOffer @NotNull [] offers) throws IllegalArgumentException
      Sets the offers to provide to the player.
      Parameters:
      offers - The offers to provide
      Throws:
      IllegalArgumentException - if the array length isn't 3
      Since:
      1.21