Interface Container

All Known Subinterfaces:
AnvilContainer, BeaconContainer, BrewingStandContainer, EnchantmentTableContainer, FurnaceContainer, Inventory, LecternContainer, LoomContainer, StonecutterContainer

public interface Container
Represents a container of items.
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Interface
    Description
    static enum 
    All possible types a container can have.
  • Method Summary

    Modifier and Type
    Method
    Description
    @NotNull ItemStack
    item(int index)
    Gets an item by its index.
    @NotNull ItemStack
    item(int index, @NotNull ItemStack item)
    Sets the item at the specified index.
    @NotNull List<ItemStack>
    Gets the underlying list of items.
    @NotNull Component
    Gets the title of the container.
    Gets the type of the container
  • Method Details

    • title

      @NotNull @NotNull Component title()
      Gets the title of the container.
      Returns:
      the title of the container
      Since:
      1.0.0
    • type

      @NotNull @NotNull Container.Type type()
      Gets the type of the container
      Returns:
      the type of the container
      Since:
      1.0.0
    • item

      @NotNull @NotNull ItemStack item(int index, @NotNull @NotNull ItemStack item)
      Sets the item at the specified index.
      Parameters:
      index - the index of the item
      item - the item to set
      Returns:
      the item previously at the index
      Since:
      1.0.0
    • item

      @NotNull @NotNull ItemStack item(int index)
      Gets an item by its index.
      Parameters:
      index - the index of the item
      Returns:
      the item at the specified index
      Since:
      1.0.0
    • items

      @NotNull @NotNull List<ItemStack> items()
      Gets the underlying list of items.
      Returns:
      the list of items
      Since:
      1.0.0