类 InventoryInteractEvent

java.lang.Object
org.bukkit.event.Event
org.bukkit.event.inventory.InventoryEvent
org.bukkit.event.inventory.InventoryInteractEvent
所有已实现的接口:
Cancellable
直接已知子类:
InventoryClickEvent, InventoryDragEvent, TradeSelectEvent

public abstract class InventoryInteractEvent extends InventoryEvent implements Cancellable
An abstract base class for events that describe an interaction between a HumanEntity and the contents of an Inventory.
  • 构造器详细资料

  • 方法详细资料

    • getWhoClicked

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

      public void setResult(@NotNull @NotNull Event.Result newResult)
      Sets the result of this event. This will change whether or not this event is considered cancelled.
      参数:
      newResult - the new Event.Result for this event
      另请参阅:
    • getResult

      @NotNull public @NotNull 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.
      返回:
      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

      指定者:
      isCancelled 在接口中 Cancellable
      返回:
      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.

      指定者:
      setCancelled 在接口中 Cancellable
      参数:
      toCancel - result becomes DENY if true, ALLOW if false