类 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
描述 HumanEntity 与物品栏内容之间交互的事件的抽象基类。
  • 构造器详细资料

  • 方法详细资料

    • getWhoClicked

      @NotNull public @NotNull HumanEntity getWhoClicked()
      获取执行点击的玩家。
      返回:
      点击的玩家

      原文:Gets the player who performed the click.

    • setResult

      public void setResult(@NotNull @NotNull Event.Result newResult)
      设置此事件的结果。这将改变此事件是否被视为已取消。
      参数:
      newResult - 此事件的新 Event.Result
      另请参阅:
    • getResult

      @NotNull public @NotNull Event.Result getResult()
      获取此事件的 Event.Result。Result 描述了将应用于此事件相关物品栏的行为。
      返回:
      此事件的结果

      原文:Gets the Event.Result of this event. The Result describes the behavior that will be applied to the inventory in relation to this event.

    • isCancelled

      public boolean isCancelled()
      获取此事件是否被取消。这基于 getResult() 返回的 Result 值。Result.ALLOW 和 Result.DEFAULT 将导致返回值为 false,但 Result.DENY 将导致返回值为 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
      返回:
      事件是否被取消

      原文: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.

    • setCancelled

      public void setCancelled(boolean toCancel)
      Cancellable 接口的 setResult(org.bukkit.event.Event.Result) 代理方法。推荐使用 setResult(org.bukkit.event.Event.Result),因为它允许您指定超出 Result.DENY 和 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 - 如果为 true,结果变为 DENY;如果为 false,结果变为 ALLOW

      原文: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.