类 PrepareItemEnchantEvent

java.lang.Object
org.bukkit.event.Event
org.bukkit.event.inventory.InventoryEvent
org.bukkit.event.enchantment.PrepareItemEnchantEvent
所有已实现的接口:
Cancellable

public class PrepareItemEnchantEvent extends InventoryEvent implements Cancellable
物品塞入附魔台的事件 - 可被多次调用。
  • 构造器详细资料

  • 方法详细资料

    • getEnchanter

      @NotNull public @NotNull Player getEnchanter()
      获取正在为物品附魔的玩家.

      原文: Gets the player enchanting the item

      返回:
      正在为物品附魔的玩家
    • getEnchantBlock

      @NotNull public @NotNull Block getEnchantBlock()
      获取附魔台方块.

      原文: Gets the block being used to enchant the item

      返回:
      附魔台方块
    • getItem

      @NotNull public @NotNull ItemStack getItem()
      获取准备附魔的物品(可改动).

      原文: Gets the item to be enchanted (can be modified)

      返回:
      附魔的物品ItemStack对象
    • getExpLevelCostsOffered

      @NotNull public @org.jetbrains.annotations.NotNull int[] getExpLevelCostsOffered()
      已过时。
      请换用 getOffers() 方法
      获取附魔所需要的等级的列表.

      原文:Get a list of offered experience level costs of the enchantment.

      返回:
      附魔所需要的等级的列表
    • getOffers

      @NotNull public @NotNull EnchantmentOffer[] getOffers()
      获取对玩家可用的的附魔选项列表. 你可以修改这些值以干预对玩家可用的附魔. 如果附魔台中某个特定的格子没有附魔选项, 则这个附魔选项可能为null. 附魔台中有3个附魔选项格可供编辑.

      原文:Get a list of available 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.

      返回:
      可用的的附魔选项列表
    • getEnchantmentBonus

      public int getEnchantmentBonus()
      获取生效的附魔等级加成 - 对应书架的数量.

      原文:Get enchantment bonus in effect - corresponds to number of bookshelves

      返回:
      附魔等级加成
    • 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

      @NotNull public @NotNull HandlerList getHandlers()
      覆盖:
      getHandlers 在类中 InventoryEvent
    • getHandlerList

      @NotNull public static @NotNull HandlerList getHandlerList()