Class MenuOptionClicked


  • public class MenuOptionClicked
    extends 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.

    • Constructor Detail

      • MenuOptionClicked

        public MenuOptionClicked​(MenuEntry menuEntry)
    • Method Detail

      • 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 String getMenuOption()
        The option text added to the menu.
      • getMenuTarget

        public 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.
      • isItemOp

        public boolean isItemOp()
        Test if this menu entry is an item op. "Use" and "Examine" are not considered item ops.
        Returns:
      • getItemOp

        public int getItemOp()
        If this menu entry is an item op, get the item op id
        Returns:
        1-5
      • getItemId

        public int getItemId()
        If this menu entry is an item op, get the item id
        Returns:
        See Also:
        ItemID, NullItemID
      • getWidget

        @Nullable
        public Widget getWidget()
        Get the widget this menu entry is on, if this is a menu entry with an associated widget. Such as eg, CC_OP.
        Returns:
      • 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.
      • canEqual

        protected boolean canEqual​(Object other)
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object
      • getMenuEntry

        public MenuEntry getMenuEntry()
        The clicked menu entry
      • isConsumed

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