Class MenuOptionClicked


  • public class MenuOptionClicked
    extends java.lang.Object
    An event where a menu option has been clicked.

    This event does not only trigger when clicking an option in a right-clicked menu. The event will trigger for any left click action performed (ie. clicking an item, walking to a tile, etc) as well as any right-click menu option.

    By default, when there is no action performed when left-clicking, it seems that this event still triggers with the "Cancel" action.

    • Method Summary

      All Methods Instance Methods Concrete Methods Deprecated Methods 
      Modifier and Type Method Description
      protected boolean canEqual​(java.lang.Object other)  
      void consume()
      Marks the event as having been consumed.
      boolean equals​(java.lang.Object o)  
      int getActionParam()
      Deprecated.
      int getId()
      The ID of the object, actor, or item that the interaction targets.
      MenuAction getMenuAction()
      The action performed.
      java.lang.String getMenuOption()
      The option text added to the menu.
      java.lang.String getMenuTarget()
      The target of the action.
      int getParam0()
      Action parameter 0.
      int getParam1()
      Action parameter 1.
      int getSelectedItemIndex()
      The selected item index at the time of the option click.
      int getWidgetId()
      Deprecated.
      int hashCode()  
      boolean isConsumed()
      Whether or not the event has been consumed by a subscriber.
      void setConsumed​(boolean consumed)
      Whether or not the event has been consumed by a subscriber.
      void setId​(int id)
      The ID of the object, actor, or item that the interaction targets.
      void setMenuAction​(MenuAction menuAction)
      The action performed.
      void setMenuOption​(java.lang.String menuOption)
      The option text added to the menu.
      void setMenuTarget​(java.lang.String menuTarget)
      The target of the action.
      void setParam0​(int param0)
      Action parameter 0.
      void setParam1​(int param1)
      Action parameter 1.
      void setSelectedItemIndex​(int selectedItemIndex)
      The selected item index at the time of the option click.
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • MenuOptionClicked

        public MenuOptionClicked()
    • Method Detail

      • consume

        public void consume()
        Marks the event as having been consumed.

        Setting this state indicates that a plugin has processed the menu option being clicked and that the event will not be passed on for handling by vanilla client code.

      • getActionParam

        @Deprecated
        public int getActionParam()
        Deprecated.
      • getWidgetId

        @Deprecated
        public int getWidgetId()
        Deprecated.
      • getParam0

        public int getParam0()
        Action parameter 0. Its value depends on the menuAction.
      • getParam1

        public int getParam1()
        Action parameter 1. Its value depends on the menuAction.
      • getMenuOption

        public java.lang.String getMenuOption()
        The option text added to the menu.
      • getMenuTarget

        public java.lang.String getMenuTarget()
        The target of the action.
      • getMenuAction

        public MenuAction getMenuAction()
        The action performed.
      • getId

        public int getId()
        The ID of the object, actor, or item that the interaction targets.
      • getSelectedItemIndex

        public int getSelectedItemIndex()
        The selected item index at the time of the option click.
      • isConsumed

        public boolean isConsumed()
        Whether or not the event has been consumed by a subscriber.
      • setParam0

        public void setParam0​(int param0)
        Action parameter 0. Its value depends on the menuAction.
      • setParam1

        public void setParam1​(int param1)
        Action parameter 1. Its value depends on the menuAction.
      • setMenuOption

        public void setMenuOption​(java.lang.String menuOption)
        The option text added to the menu.
      • setMenuTarget

        public void setMenuTarget​(java.lang.String menuTarget)
        The target of the action.
      • setMenuAction

        public void setMenuAction​(MenuAction menuAction)
        The action performed.
      • setId

        public void setId​(int id)
        The ID of the object, actor, or item that the interaction targets.
      • setSelectedItemIndex

        public void setSelectedItemIndex​(int selectedItemIndex)
        The selected item index at the time of the option click.
      • setConsumed

        public void setConsumed​(boolean consumed)
        Whether or not the event has been consumed by a subscriber.
      • equals

        public boolean equals​(java.lang.Object o)
        Overrides:
        equals in class java.lang.Object
      • canEqual

        protected boolean canEqual​(java.lang.Object other)
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object