程序包 org.bukkit.event.inventory

# 类 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.

- ## 嵌套类概要

  ## 从类继承的嵌套类/接口 org.bukkit.event.Event

  `Event.Result`

- ## 字段概要

  ### 从类继承的字段 org.bukkit.event.inventory.InventoryEvent

  `transaction`

- ## 构造器概要

  构造器
  构造器
  说明
  `InventoryInteractEvent(@NotNull InventoryView transaction)`

- ## 方法概要

  修饰符和类型
  方法
  说明
  `@NotNull Event.Result`
  `getResult()`
  Gets the `Event.Result` of this event.
  `@NotNull HumanEntity`
  `getWhoClicked()`
  Gets the player who performed the click.
  `boolean`
  `isCancelled()`
  Gets whether or not this event is cancelled.
  `void`
  `setCancelled(boolean toCancel)`
  Proxy method to `setResult(org.bukkit.event.Event.Result)` for the Cancellable interface.
  `void`
  `setResult(@NotNull Event.Result newResult)`
  Sets the result of this event.

  ### 从类继承的方法 org.bukkit.event.inventory.InventoryEvent

  `getHandlerList, getHandlers, getInventory, getView, getViewers`

  ### 从类继承的方法 org.bukkit.event.Event

  `getEventName, isAsynchronous`

  ### 从类继承的方法 java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## 构造器详细资料

  - ### InventoryInteractEvent

    public InventoryInteractEvent(@NotNull @NotNull InventoryView transaction)

- ## 方法详细资料

  - ### 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
    另请参阅:
      - `isCancelled()`

  - ### 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