Class IconMenu

java.lang.Object
me.gigawartrex.smalladditions.helpers.IconMenu
All Implemented Interfaces:
org.bukkit.event.Listener

public class IconMenu extends Object implements org.bukkit.event.Listener
Class to instantiate an interactive inventory menu. This class was taken from bukkit.org as documented below (27. December 2020).
Author:
nisovin
See Also:
  • Constructor Details

    • IconMenu

      public IconMenu(String name, int size, IconMenu.OptionClickEventHandler handler, org.bukkit.plugin.Plugin plugin)
      Class constructor.
      Parameters:
      name - the name of the menu
      size - the size of the menu, must be a multiple of 9
      handler - the IconMenu.OptionClickEventHandler handler to detect item clicks
      plugin - the reference to the bukkit plugin
  • Method Details

    • setOption

      public IconMenu setOption(int position, org.bukkit.inventory.ItemStack icon, String name, String... info)
      Method to set an inventory slot to a specific item with information.
      Parameters:
      position - the position in the inventory, starting with 0
      icon - the ItemStack to be displayed
      name - the name of the option
      info - the popup information when hovering over the icon
      Returns:
      the resulting IconMenu
    • open

      public void open(org.bukkit.entity.Player player)
      Method to open the inventory for the specified player.
      Parameters:
      player - the target Player
    • destroy

      public void destroy()
      Method to destroy the current IconMenu object.