Class Item

All Implemented Interfaces:
Id, Interactable

public class Item extends BaseItem implements Interactable
Represents an item stack in an interactive item container, such as inventory, bank, or equipment.
  • Constructor Details

  • Method Details

    • valid

      public static boolean valid(int id)
      Returns whether the item id represents a real item entry.
    • id

      public int id()
      Description copied from class: BaseItem
      Returns the item id.
      Specified by:
      id in interface Id
      Specified by:
      id in class BaseItem
    • stackSize

      public int stackSize()
      Description copied from class: BaseItem
      Returns the stack size.
      Specified by:
      stackSize in class BaseItem
    • slot

      public int slot()
      Returns the item slot inside its container.
    • component

      public Optional<IfComponent> component()
      Returns the interface component that currently backs this item stack.

      Items created from non-component contexts may return Optional.empty().

    • options

      public List<MenuOption> options()
      Description copied from interface: Interactable
      Returns menu options associated with this interactable.
      Specified by:
      options in interface Interactable
    • target

      public boolean target()
      Description copied from interface: Interactable
      Performs the target action used when a selected component/item/spell targets this object. Returns true when the target action was performed.
      Specified by:
      target in interface Interactable
    • select

      public boolean select()
      Description copied from interface: Interactable
      Performs the use/select action for this object. Returns true when the "Use" action was performed.
      Specified by:
      select in interface Interactable
    • resumePause

      public boolean resumePause()
      Enqueues the resume/pause-button action.