类 Enchantment

java.lang.Object
org.bukkit.enchantments.Enchantment
直接已知子类:
EnchantmentWrapper

public abstract class Enchantment extends Object
附魔类.
  • 字段详细资料

    • PROTECTION_ENVIRONMENTAL

      public static final Enchantment PROTECTION_ENVIRONMENTAL
      附魔:保护

      原文: Provides protection against environmental damage

    • PROTECTION_FIRE

      public static final Enchantment PROTECTION_FIRE
      附魔:火焰保护

      原文: Provides protection against fire damage

    • PROTECTION_FALL

      public static final Enchantment PROTECTION_FALL
      附魔:摔落保护

      原文: Provides protection against fall damage

    • PROTECTION_EXPLOSIONS

      public static final Enchantment PROTECTION_EXPLOSIONS
      附魔:爆炸保护

      原文: Provides protection against explosive damage

    • PROTECTION_PROJECTILE

      public static final Enchantment PROTECTION_PROJECTILE
      附魔:抛射物保护

      原文: Provides protection against projectile damage

    • OXYGEN

      public static final Enchantment OXYGEN
      附魔:水肺

      原文: Decreases the rate of air loss whilst underwater

    • WATER_WORKER

      public static final Enchantment WATER_WORKER
      附魔:水下速掘

      原文: Increases the speed at which a player may mine underwater

    • THORNS

      public static final Enchantment THORNS
      附魔:荆棘

      原文: Damages the attacker

    • DEPTH_STRIDER

      public static final Enchantment DEPTH_STRIDER
      附魔:海底漫步

      原文: Increases walking speed while in water

    • FROST_WALKER

      public static final Enchantment FROST_WALKER
      附魔:冰霜行者

      原文:Freezes any still water adjacent to ice / frost which player is walking on

    • BINDING_CURSE

      public static final Enchantment BINDING_CURSE
      Item cannot be removed
    • DAMAGE_ALL

      public static final Enchantment DAMAGE_ALL
      附魔:锋利

      原文: Increases damage against all targets

    • DAMAGE_UNDEAD

      public static final Enchantment DAMAGE_UNDEAD
      附魔:亡灵杀手

      原文: Increases damage against undead targets

    • DAMAGE_ARTHROPODS

      public static final Enchantment DAMAGE_ARTHROPODS
      附魔:节肢杀手

      原文: Increases damage against arthropod targets

    • KNOCKBACK

      public static final Enchantment KNOCKBACK
      附魔:击退

      原文: All damage to other targets will knock them back when hit

    • FIRE_ASPECT

      public static final Enchantment FIRE_ASPECT
      附魔:火焰附加

      原文: When attacking a target, has a chance to set them on fire

    • LOOT_BONUS_MOBS

      public static final Enchantment LOOT_BONUS_MOBS
      附魔:抢夺

      原文: Provides a chance of gaining extra loot when killing monsters

    • SWEEPING_EDGE

      public static final Enchantment SWEEPING_EDGE
      Increases damage against targets when using a sweep attack
    • DIG_SPEED

      public static final Enchantment DIG_SPEED
      附魔:效率

      原文: Increases the rate at which you mine/dig

    • SILK_TOUCH

      public static final Enchantment SILK_TOUCH
      附魔:精准采集

      原文: Allows blocks to drop themselves instead of fragments (for example, stone instead of cobblestone)

    • DURABILITY

      public static final Enchantment DURABILITY
      附魔:耐久

      原文: Decreases the rate at which a tool looses durability

    • LOOT_BONUS_BLOCKS

      public static final Enchantment LOOT_BONUS_BLOCKS
      附魔:时运

      原文: Provides a chance of gaining extra loot when destroying blocks

    • ARROW_DAMAGE

      public static final Enchantment ARROW_DAMAGE
      附魔:力量 (弓)

      原文: Provides extra damage when shooting arrows from bows

    • ARROW_KNOCKBACK

      public static final Enchantment ARROW_KNOCKBACK
      附魔:击退 (弓)

      原文: Provides a knockback when an entity is hit by an arrow from a bow

    • ARROW_FIRE

      public static final Enchantment ARROW_FIRE
      附魔:火焰附加 (弓)

      原文: Sets entities on fire when hit by arrows shot from a bow

    • ARROW_INFINITE

      public static final Enchantment ARROW_INFINITE
      附魔:无限 (弓)

      原文: Provides infinite arrows when shooting a bow

    • LUCK

      public static final Enchantment LUCK
      附魔:海之眷顾 (钓鱼杆)

      原文: Decreases odds of catching worthless junk

    • LURE

      public static final Enchantment LURE
      附魔:诱饵 (钓鱼杆)

      原文: Increases rate of fish biting your hook

    • MENDING

      public static final Enchantment MENDING
      附魔:经验修补

      原文:Allows mending the item using experience orbs

    • VANISHING_CURSE

      public static final Enchantment VANISHING_CURSE
      Item disappears instead of dropping
  • 构造器详细资料

    • Enchantment

      public Enchantment(int id)
  • 方法详细资料

    • getId

      @Deprecated public int getId()
      已过时。
      不安全的参数
      得到这个附魔独一无二的ID.

      原文: Gets the unique ID of this enchantment

      返回:
      独一无二的ID
    • getName

      public abstract String getName()
      得到这个附魔的名称.

      原文: Gets the unique name of this enchantment

      返回:
      独一无二的名称
    • getMaxLevel

      public abstract int getMaxLevel()
      得到这个附魔所支持的最大等级.

      原文: Gets the maximum level that this Enchantment may become.

      返回:
      这个附魔的最大等级
    • getStartLevel

      public abstract int getStartLevel()
      得到这个附魔的最小等级.

      原文: Gets the level that this Enchantment should start at

      返回:
      这个附魔最小等级
    • getItemTarget

      public abstract EnchantmentTarget getItemTarget()
      得到这个附魔所支持的 物品 ItemStack.

      原文: Gets the type of ItemStack that may fit this Enchantment.

      返回:
      这个附魔的目标物品.
    • isTreasure

      public abstract boolean isTreasure()
      Checks if this enchantment is a treasure enchantment.
      Treasure enchantments can only be received via looting, trading, or fishing.
      返回:
      true if the enchantment is a treasure enchantment
    • isCursed

      public abstract boolean isCursed()
      Checks if this enchantment is a cursed enchantment
      Cursed enchantments are found the same way treasure enchantments are
      返回:
      true if the enchantment is cursed
    • conflictsWith

      public abstract boolean conflictsWith(Enchantment other)
      检查这个附魔是否与另外的附魔冲突.

      原文: Check if this enchantment conflicts with another enchantment.

      参数:
      other - 另外一个附魔
      返回:
      如果这两个附魔是冲突的则返回true
    • canEnchantItem

      public abstract boolean canEnchantItem(ItemStack item)
      检查该附魔支不支持某物品.

      这并不检查任何物品上与它冲突的附魔。

      原文:Checks if this Enchantment may be applied to the given ItemStack.

      This does not check if it conflicts with any enchantments already applied to the item.

      参数:
      item - 物品
      返回:
      True 如果该附魔适用该物品,则返回true。
    • equals

      public boolean equals(Object obj)
      覆盖:
      equals 在类中 Object
    • hashCode

      public int hashCode()
      覆盖:
      hashCode 在类中 Object
    • toString

      public String toString()
      覆盖:
      toString 在类中 Object
    • registerEnchantment

      public static void registerEnchantment(Enchantment enchantment)
      注册一个附魔的ID和对象.

      一般不在插件中使用.

      原文: Registers an enchantment with the given ID and object.

      Generally not to be used from within a plugin.

      参数:
      enchantment - 用于注册的附魔
    • isAcceptingRegistrations

      public static boolean isAcceptingRegistrations()
      检查是否接受附魔注册 .

      原文: Checks if this is accepting Enchantment registrations.

      返回:
      如果服务器可能实现添加附魔则返回True
    • stopAcceptingRegistrations

      public static void stopAcceptingRegistrations()
      停止接受任何附魔注册.

      原文: Stops accepting any enchantment registrations

    • getById

      @Deprecated public static Enchantment getById(int id)
      已过时。
      魔法值
      获取附魔的指定id.

      原文: Gets the Enchantment at the specified ID

      参数:
      id - ID
      返回:
      返回该ID所对应的附魔,要是没有所对应的的附魔则返回null.
    • getByName

      public static Enchantment getByName(String name)
      获取附魔的指定名称.

      原文: Gets the Enchantment at the specified name

      参数:
      name - 名称
      返回:
      返回该名称所对应的附魔,要是没有所对应的的附魔则返回null.
    • values

      public static Enchantment[] values()
      得到所有已经注册了的附魔( Enchantments).

      原文: Gets an array of all the registered Enchantments

      返回:
      一个数组