public class PrepareItemEnchantEvent extends InventoryEvent implements Cancellable
Event.Result
transaction
构造器和说明 |
---|
PrepareItemEnchantEvent(Player enchanter,
InventoryView view,
Block table,
ItemStack item,
EnchantmentOffer[] offers,
int bonus) |
限定符和类型 | 方法和说明 |
---|---|
Block |
getEnchantBlock()
获取附魔台方块.
|
Player |
getEnchanter()
获取正在为物品附魔的玩家.
|
int |
getEnchantmentBonus()
Get enchantment bonus in effect - corresponds to number of bookshelves
|
int[] |
getExpLevelCostsOffered()
已过时。
请换用
getOffers() 方法 |
static HandlerList |
getHandlerList() |
HandlerList |
getHandlers() |
ItemStack |
getItem()
获取准备附魔的物品(可改动).
|
EnchantmentOffer[] |
getOffers()
Get a list of available
EnchantmentOffer for the player. |
boolean |
isCancelled()
获取这个事件是否被取消.一个被取消的事件不会在服务器里被执行,但是仍然会传递事件到其他插件。
|
void |
setCancelled(boolean cancel)
取消这个事件.
|
getInventory, getView, getViewers
getEventName, isAsynchronous
public PrepareItemEnchantEvent(Player enchanter, InventoryView view, Block table, ItemStack item, EnchantmentOffer[] offers, int bonus)
public Player getEnchanter()
原文: Gets the player enchanting the item
public Block getEnchantBlock()
原文: Gets the block being used to enchant the item
public ItemStack getItem()
原文: Gets the item to be enchanted (can be modified)
public int[] getExpLevelCostsOffered()
getOffers()
方法原文:Get a list of offered experience level costs of the enchantment.
public EnchantmentOffer[] getOffers()
EnchantmentOffer
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.public int getEnchantmentBonus()
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
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
- 如果你想取消这个事件,则为truepublic HandlerList getHandlers()
getHandlers
在类中 InventoryEvent
public static HandlerList getHandlerList()