Class HotbarMenu

java.lang.Object
net.playavalon.mythicdungeons.player.Hotbar
net.playavalon.mythicdungeons.menu.HotbarMenu
All Implemented Interfaces:
org.bukkit.event.Listener

public abstract class HotbarMenu extends Hotbar implements org.bukkit.event.Listener
  • Constructor Details

    • HotbarMenu

      public HotbarMenu()
  • Method Details

    • setHotbar

      public void setHotbar(org.bukkit.inventory.PlayerInventory inv)
      Overrides:
      setHotbar in class Hotbar
    • setHotbar

      public void setHotbar(org.bukkit.inventory.PlayerInventory inv, boolean setHand)
      Overrides:
      setHotbar in class Hotbar
    • addMenuItem

      public void addMenuItem(MenuItem item)
    • addMenuItem

      public void addMenuItem(int slot, MenuItem item)
    • removeMenuItem

      public void removeMenuItem(int slot)
    • buildMenu

      public void buildMenu()
      Used to build and populate the hotbar with items. This is where you set up and assign the buttons. Use `setItem(slot, button.getItem())` to assign the button to a slot, where `slot` = the position in the hotbar (0-8), and `button` = a MenuButton object.
      See Also:
    • updateMenu

      public void updateMenu(MythicPlayer aPlayer)
    • initSelectActions

      public void initSelectActions()
      Used to set up and assign code to perform upon a button being selected. You can use `AvalonPlayer.setChatListening(true)` in here if you want to allow player input via text. Override `initChatActions` to use the chat message. Use `selectActions.put(buttonID, clickEvent -> { [code here] })` to assign an action to a buttonID (matching one of the buttons set up in updateMenu()), where the action is a block of code to perform upon this button being right-clicked. `clickEvent` corresponds with the PlayerInteractEvent associated with this message. You can use it to retrieve the player and other data about the right-click.
    • initChatActions

      public void initChatActions()
      Used to set up and assign code to perform upon a chat message being sent while the chat listener is active. Use `chatActions.put(buttonID, chatEvent -> { [code here] })` to assign an action to a buttonID (matching one of the buttons set up in updateMenu()), where the action is a block of code to perform upon the player submitting a chat message. `chatEvent` corresponds with the AsyncPlayerChatEvent associated with this message. You can use it to retrieve the player, message, etc.
    • initHoverActions

      public void initHoverActions()
      WARNING :: UNIMPLEMENTED Used to set up and assign code to perform upon scrolling over to a hotbar menu item. Use `hoverActions.put(buttonID, hoverEvent -> { [code here] })` to assign an action to a button ID (matching one of the buttons set up in updateMenu()), where the action is a block of code to perform upon the player hovering over this hotbar slot. Useful for informing the player of information about the option they hovered over. `hoverEvent` corresponds with a PlayerItemHeldEvent associated with this message. You can use it to retrieve the player and other data about the slots.
    • onSlotSelect

      public void onSlotSelect(org.bukkit.event.player.PlayerInteractEvent event)
    • onSlotSelect

      public void onSlotSelect(org.bukkit.event.player.PlayerInteractAtEntityEvent event)
    • onChat

      public void onChat(org.bukkit.event.player.AsyncPlayerChatEvent event)
    • onClickHotbarItem

      public void onClickHotbarItem(org.bukkit.event.inventory.InventoryClickEvent event)
    • onClickHotbarItem

      public void onClickHotbarItem(org.bukkit.event.inventory.InventoryCreativeEvent event)
    • onDragHotbarItem

      public void onDragHotbarItem(org.bukkit.event.inventory.InventoryDragEvent event)
    • onHover

      public void onHover(org.bukkit.event.player.PlayerItemHeldEvent event)