类 EnchantmentLevelSetEvent

java.lang.Object
net.minecraftforge.eventbus.api.Event
net.minecraftforge.event.enchanting.EnchantmentLevelSetEvent

public class EnchantmentLevelSetEvent extends net.minecraftforge.eventbus.api.Event
Fired when the enchantment level is set for each of the three potential enchantments in the enchanting table. The level is set to the vanilla value and can be modified by this event handler. The enchantRow is used to determine which enchantment level is being set, 1, 2, or 3. The power is a number from 0-15 and indicates how many bookshelves surround the enchanting table. The itemStack representing the item being enchanted is also available.
  • 嵌套类概要

    从类继承的嵌套类/接口 net.minecraftforge.eventbus.api.Event

    net.minecraftforge.eventbus.api.Event.HasResult, net.minecraftforge.eventbus.api.Event.Result
  • 字段概要

    字段
    修饰符和类型
    字段
    说明
    private int
     
    private final int
     
    private final @NotNull ItemStack
     
    private final Level
     
    private final int
     
    private final BlockPos
     
    private final int
     
  • 构造器概要

    构造器
    构造器
    说明
    EnchantmentLevelSetEvent(Level level, BlockPos pos, int enchantRow, int power, @NotNull ItemStack itemStack, int enchantLevel)
     
  • 方法概要

    修饰符和类型
    方法
    说明
    int
    Get the level of the enchantment for this row (0-30)
    int
    Get the row for which the enchantment level is being set
    @NotNull ItemStack
    Get the item being enchanted
    Get the world object
    int
    Get the original level of the enchantment for this row (0-30)
    Get the pos of the enchantment table
    int
    Get the power (# of bookshelves) for the enchanting table
    void
    setEnchantLevel(int level)
    Set the new level of the enchantment (0-30)

    从类继承的方法 net.minecraftforge.eventbus.api.Event

    getListenerList, getPhase, getResult, hasResult, isCancelable, isCanceled, setCanceled, setPhase, setResult

    从类继承的方法 java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 字段详细资料

    • level

      private final Level level
    • pos

      private final BlockPos pos
    • enchantRow

      private final int enchantRow
    • power

      private final int power
    • itemStack

      @NotNull private final @NotNull ItemStack itemStack
    • originalLevel

      private final int originalLevel
    • enchantLevel

      private int enchantLevel
  • 构造器详细资料

    • EnchantmentLevelSetEvent

      public EnchantmentLevelSetEvent(Level level, BlockPos pos, int enchantRow, int power, @NotNull @NotNull ItemStack itemStack, int enchantLevel)
  • 方法详细资料

    • getLevel

      public Level getLevel()
      Get the world object
      返回:
      the world object
    • getPos

      public BlockPos getPos()
      Get the pos of the enchantment table
      返回:
      the pos of the enchantment table
    • getEnchantRow

      public int getEnchantRow()
      Get the row for which the enchantment level is being set
      返回:
      the row for which the enchantment level is being set
    • getPower

      public int getPower()
      Get the power (# of bookshelves) for the enchanting table
      返回:
      the power (# of bookshelves) for the enchanting table
    • getItem

      @NotNull public @NotNull ItemStack getItem()
      Get the item being enchanted
      返回:
      the item being enchanted
    • getOriginalLevel

      public int getOriginalLevel()
      Get the original level of the enchantment for this row (0-30)
      返回:
      the original level of the enchantment for this row (0-30)
    • getEnchantLevel

      public int getEnchantLevel()
      Get the level of the enchantment for this row (0-30)
      返回:
      the level of the enchantment for this row (0-30)
    • setEnchantLevel

      public void setEnchantLevel(int level)
      Set the new level of the enchantment (0-30)
      参数:
      level - the new level of the enchantment (0-30)