类 PrepareItemEnchantEvent
java.lang.Object
org.bukkit.event.Event
org.bukkit.event.inventory.InventoryEvent
org.bukkit.event.enchantment.PrepareItemEnchantEvent
- 所有已实现的接口:
Cancellable
物品塞入附魔台的事件 - 可以同时调用。
-
嵌套类概要
从类继承的嵌套类/接口 org.bukkit.event.Event
Event.Result
-
字段概要
从类继承的字段 org.bukkit.event.inventory.InventoryEvent
transaction
-
构造器概要
构造器说明PrepareItemEnchantEvent
(Player enchanter, InventoryView view, Block table, ItemStack item, EnchantmentOffer[] offers, int bonus) -
方法概要
修饰符和类型方法说明获取附魔台方块.获取正在为物品附魔的玩家.int
Get enchantment bonus in effect - corresponds to number of bookshelvesint[]
已过时。static HandlerList
getItem()
获取准备附魔的物品(可改动).Get a list of availableEnchantmentOffer
for the player.boolean
获取这个事件是否被取消.一个被取消的事件不会在服务器里被执行,但是仍然会传递事件到其他插件。void
setCancelled
(boolean cancel) 取消这个事件.从类继承的方法 org.bukkit.event.inventory.InventoryEvent
getInventory, getView, getViewers
从类继承的方法 org.bukkit.event.Event
getEventName, isAsynchronous
-
构造器详细资料
-
PrepareItemEnchantEvent
public PrepareItemEnchantEvent(Player enchanter, InventoryView view, Block table, ItemStack item, EnchantmentOffer[] offers, int bonus)
-
-
方法详细资料
-
getEnchanter
获取正在为物品附魔的玩家.原文: Gets the player enchanting the item
- 返回:
- 正在为物品附魔的玩家
-
getEnchantBlock
获取附魔台方块.原文: Gets the block being used to enchant the item
- 返回:
- 附魔台方块
-
getItem
获取准备附魔的物品(可改动).原文: Gets the item to be enchanted (can be modified)
- 返回:
- 附魔的物品ItemStack对象
-
getExpLevelCostsOffered
public int[] getExpLevelCostsOffered()已过时。请换用getOffers()
方法获取附魔所需要的等级的列表.原文:Get a list of offered experience level costs of the enchantment.
- 返回:
- 附魔所需要的等级的列表
-
getOffers
Get a list of availableEnchantmentOffer
for the player. You can modify the values to change the available offers for the player. An offer may be null, if there isn't a enchantment offer at a specific slot. There are 3 slots in the enchantment table available to modify.- 返回:
- list of available enchantment offers
-
getEnchantmentBonus
public int getEnchantmentBonus()Get enchantment bonus in effect - corresponds to number of bookshelves- 返回:
- enchantment bonus
-
isCancelled
public boolean isCancelled()从接口复制的说明:Cancellable
获取这个事件是否被取消.一个被取消的事件不会在服务器里被执行,但是仍然会传递事件到其他插件。原文: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
- 返回:
- 如果事件已经被取消,则为true
-
setCancelled
public void setCancelled(boolean cancel) 从接口复制的说明:Cancellable
取消这个事件. 一个被取消的事件不会在 服务器里被执行,但是仍然会传递事件到其他插件。原文: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
- 参数:
cancel
- 如果你想取消这个事件,则为true
-
getHandlers
- 覆盖:
getHandlers
在类中InventoryEvent
-
getHandlerList
-
getOffers()
方法