Class InventoryInteractEvent

    • Constructor Detail

      • InventoryInteractEvent

        public InventoryInteractEvent​(@NotNull
                                      InventoryView transaction)
    • Method Detail

      • getWhoClicked

        @NotNull
        public HumanEntity getWhoClicked()
        Gets the player who performed the click.
        Returns:
        The clicking player.
      • setResult

        public void setResult​(@NotNull
                              Event.Result newResult)
        Sets the result of this event. This will change whether or not this event is considered cancelled.
        Parameters:
        newResult - the new Event.Result for this event
        See Also:
        isCancelled()
      • getResult

        @NotNull
        public Event.Result getResult()
        Gets the Event.Result of this event. The Result describes the behavior that will be applied to the inventory in relation to this event.
        Returns:
        the Result of this event.
      • isCancelled

        public boolean isCancelled()
        Gets whether or not this event is cancelled. This is based off of the Result value returned by getResult(). Result.ALLOW and Result.DEFAULT will result in a returned value of false, but Result.DENY will result in a returned value of true.

        Gets the cancellation state of this event. A cancelled event will not be executed in the server, but will still pass to other plugins

        Specified by:
        isCancelled in interface Cancellable
        Returns:
        whether the event is cancelled
      • setCancelled

        public void setCancelled​(boolean toCancel)
        Proxy method to setResult(org.bukkit.event.Event.Result) for the Cancellable interface. setResult(org.bukkit.event.Event.Result) is preferred, as it allows you to specify the Result beyond Result.DENY and Result.ALLOW.

        Sets the cancellation state of this event. A cancelled event will not be executed in the server, but will still pass to other plugins.

        Specified by:
        setCancelled in interface Cancellable
        Parameters:
        toCancel - result becomes DENY if true, ALLOW if false