InventoryOpenEvent
InventoryOpenEvent
=> org.bukkit.event.Event
=> org.bukkit.event.inventory.InventoryEvent
=> org.bukkit.event.inventory.InventoryOpenEvent
Represents a player related inventory event代表与玩家有关的物品栏事件。译注:文档有误。本事件文档与InventoryEvent
一致,有挪用抄袭之嫌。本事件在玩家打开物品栏时触发。玩家打开自己的背包时,不会触发本事件。打开自己的物品栏是纯粹的客户端行为。
方法声明: public final HumanEntity getPlayer()
方法签名: ()Lorg/bukkit/entity/HumanEntity;
Returns the player involved in this event@return Player who is involved in this event该方法用于获取涉事玩家。@return 涉事玩家。
方法声明: public boolean isCancelled()
方法签名: ()Z
Gets the cancellation state of this event. A cancelled event will notbe executed in the server, but will still pass to other plugins.If an inventory open event is cancelled, the inventory screen will notshow.@return true if this event is cancelled如果本事件被取消,则玩家客户端将不会显示物品栏界面。@return 如事件被取消,则返回true
。译注:原文第一段为所有isCancelled
方法共用的文档,不赘。
方法声明: public void setCancelled(boolean cancel)
方法签名: (Z)V
Sets the cancellation state of this event. A cancelled event will notbe executed in the server, but will still pass to other plugins.If an inventory open event is cancelled, the inventory screen will notshow.@param cancel true if you wish to cancel this event如果本事件被取消,则玩家客户端将不会显示物品栏界面。@param cancel 如欲取消此事件,则传入true
。译注:原文第一段为所有setCancelled
方法共用的文档,不赘。
方法声明: public HandlerList getHandlers()
方法签名: ()Lorg/bukkit/event/HandlerList;
方法声明: public static HandlerList getHandlerList()
方法签名: ()Lorg/bukkit/event/HandlerList;