public class EnchantItemEvent extends InventoryEvent implements Cancellable
Event.Result
transaction
构造器和说明 |
---|
EnchantItemEvent(Player enchanter,
InventoryView view,
Block table,
ItemStack item,
int level,
java.util.Map<Enchantment,java.lang.Integer> enchants,
int i) |
限定符和类型 | 方法和说明 |
---|---|
Block |
getEnchantBlock()
获取附魔这个物品的方块。
|
Player |
getEnchanter()
获取附魔这个物品的玩家。
|
java.util.Map<Enchantment,java.lang.Integer> |
getEnchantsToAdd()
获取被加到物品中的附魔的Map (等级, 附魔种类)(若要修改请直接修改Map) .
|
int |
getExpLevelCost()
获取花费的附魔等级。
|
static HandlerList |
getHandlerList() |
HandlerList |
getHandlers() |
ItemStack |
getItem()
获取被附魔的物品(可自定义)。
|
boolean |
isCancelled()
获取这个事件是否被取消.一个被取消的事件不会在服务器里被执行,但是仍然会传递事件到其他插件。
|
void |
setCancelled(boolean cancel)
取消这个事件.
|
void |
setExpLevelCost(int level)
设置花费的附魔等级。
|
int |
whichButton()
获取玩家点击的附魔的按钮。
|
getInventory, getView, getViewers
getEventName, isAsynchronous
public EnchantItemEvent(Player enchanter, InventoryView view, Block table, ItemStack item, int level, java.util.Map<Enchantment,java.lang.Integer> enchants, int i)
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 getExpLevelCost()
原文: Get cost in exp levels of the enchantment
public void setExpLevelCost(int level)
原文: Set cost in exp levels of the enchantment
level
- - 花费的附魔等级public java.util.Map<Enchantment,java.lang.Integer> getEnchantsToAdd()
原文: Get map of enchantment (levels, keyed by type) to be added to item - (modify map returned to change values). Note: Any enchantments not - allowed for the item will be ignored
public int whichButton()
原文: Which button was pressed to initiate the enchanting.
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()