类 Enchantment
- 所有已实现的接口:
Keyed
- 直接已知子类:
EnchantmentWrapper
-
字段概要
修饰符和类型字段说明static final Enchantment
附魔:力量 (弓)static final Enchantment
附魔:火矢 (弓)static final Enchantment
附魔:无限 (弓)static final Enchantment
附魔:冲击 (弓)static final Enchantment
附魔:绑定诅咒static final Enchantment
附魔:引雷 (三叉戟)static final Enchantment
附魔:锋利static final Enchantment
附魔:节肢杀手static final Enchantment
附魔:亡灵杀手static final Enchantment
附魔:深海探索者static final Enchantment
附魔:效率static final Enchantment
附魔:耐久static final Enchantment
附魔:火焰附加static final Enchantment
附魔:冰霜行者static final Enchantment
附魔:穿刺 (三叉戟)static final Enchantment
附魔:击退static final Enchantment
附魔:时运static final Enchantment
附魔:抢夺static final Enchantment
附魔:忠诚 (三叉戟)static final Enchantment
附魔:海之眷顾 (钓鱼杆)static final Enchantment
附魔:饵钓 (钓鱼杆)static final Enchantment
附魔:经验修补static final Enchantment
附魔:多重射击 (弩)static final Enchantment
附魔:水下呼吸static final Enchantment
附魔:穿透 (弩)static final Enchantment
附魔:保护static final Enchantment
附魔:爆炸保护static final Enchantment
附魔:摔落保护static final Enchantment
附魔:火焰保护static final Enchantment
附魔:弹射物保护static final Enchantment
附魔:快速装填 (弩)static final Enchantment
附魔:激流 (三叉戟)static final Enchantment
附魔:精准采集static final Enchantment
附魔:灵魂疾行static final Enchantment
附魔:横扫之刃static final Enchantment
附魔:迅捷潜行static final Enchantment
附魔:荆棘static final Enchantment
附魔:消失诅咒static final Enchantment
附魔:水下速掘 -
构造器概要
-
方法概要
修饰符和类型方法说明abstract boolean
canEnchantItem
(@NotNull ItemStack item) 检查该附魔支不支持某物品.abstract boolean
conflictsWith
(@NotNull Enchantment other) 检查这个附魔是否与另外的附魔冲突.boolean
static @Nullable Enchantment
通过指定键值获取附魔.static @Nullable Enchantment
已过时。abstract @NotNull EnchantmentTarget
得到这个附魔所支持的 物品ItemStack
.getKey()
返回用于此对象的命名空间标识符.abstract int
得到这个附魔所支持的最大等级.getName()
已过时。这些附魔的命名简直糟透了, 建议使用getKey()
.abstract int
得到这个附魔的最小等级.int
hashCode()
static boolean
检查是否接受附魔注册.abstract boolean
isCursed()
已过时。诅咒附魔不再是特殊的.abstract boolean
检查该附魔是否为宝藏附魔.static void
registerEnchantment
(@NotNull Enchantment enchantment) 注册一个附魔的ID和对象.static void
停止接受任何附魔注册.toString()
static @NotNull Enchantment[]
values()
得到所有已经注册了的附魔(Enchantment
).
-
字段详细资料
-
PROTECTION_ENVIRONMENTAL
附魔:保护 -
PROTECTION_FIRE
附魔:火焰保护 -
PROTECTION_FALL
附魔:摔落保护 -
PROTECTION_EXPLOSIONS
附魔:爆炸保护 -
PROTECTION_PROJECTILE
附魔:弹射物保护 -
OXYGEN
附魔:水下呼吸 -
WATER_WORKER
附魔:水下速掘 -
THORNS
附魔:荆棘 -
DEPTH_STRIDER
附魔:深海探索者 -
FROST_WALKER
附魔:冰霜行者 -
BINDING_CURSE
附魔:绑定诅咒 -
DAMAGE_ALL
附魔:锋利 -
DAMAGE_UNDEAD
附魔:亡灵杀手 -
DAMAGE_ARTHROPODS
附魔:节肢杀手 -
KNOCKBACK
附魔:击退 -
FIRE_ASPECT
附魔:火焰附加 -
LOOT_BONUS_MOBS
附魔:抢夺 -
SWEEPING_EDGE
附魔:横扫之刃 -
DIG_SPEED
附魔:效率 -
SILK_TOUCH
附魔:精准采集 -
DURABILITY
附魔:耐久 -
LOOT_BONUS_BLOCKS
附魔:时运 -
ARROW_DAMAGE
附魔:力量 (弓) -
ARROW_KNOCKBACK
附魔:冲击 (弓) -
ARROW_FIRE
附魔:火矢 (弓) -
ARROW_INFINITE
附魔:无限 (弓) -
LUCK
附魔:海之眷顾 (钓鱼杆) -
LURE
附魔:饵钓 (钓鱼杆) -
LOYALTY
附魔:忠诚 (三叉戟) -
IMPALING
附魔:穿刺 (三叉戟) -
RIPTIDE
附魔:激流 (三叉戟) -
CHANNELING
附魔:引雷 (三叉戟) -
MULTISHOT
附魔:多重射击 (弩) -
QUICK_CHARGE
附魔:快速装填 (弩) -
PIERCING
附魔:穿透 (弩) -
MENDING
附魔:经验修补 -
VANISHING_CURSE
附魔:消失诅咒 -
SOUL_SPEED
附魔:灵魂疾行 -
SWIFT_SNEAK
附魔:迅捷潜行
-
-
构造器详细资料
-
Enchantment
-
-
方法详细资料
-
getKey
从接口复制的说明:Keyed
返回用于此对象的命名空间标识符.原文:Return the namespaced identifier for this object.
-
getName
已过时。这些附魔的命名简直糟透了, 建议使用getKey()
.得到这个附魔的名称.原文: 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
- 返回:
- 这个附魔的目标物品.
-
isTreasure
public abstract boolean isTreasure()检查该附魔是否为宝藏附魔.
宝藏附魔只能通过掠夺、交易或垂钓获得.原文:Checks if this enchantment is a treasure enchantment.
Treasure enchantments can only be received via looting, trading, or fishing.- 返回:
- 是否为宝藏附魔
-
isCursed
已过时。诅咒附魔不再是特殊的. 当且仅当附魔为BINDING_CURSE
或VANISHING_CURSE
时才会返回true检查该附魔是否为诅咒附魔.
诅咒附魔的获取途径与宝藏附魔一致.原文:Checks if this enchantment is a cursed enchantment
Cursed enchantments are found the same way treasure enchantments are- 返回:
- 是否为诅咒附魔
-
conflictsWith
检查这个附魔是否与另外的附魔冲突.原文: Check if this enchantment conflicts with another enchantment.
- 参数:
other
- 另外一个附魔- 返回:
- 如果这两个附魔是冲突的则返回true
-
canEnchantItem
检查该附魔支不支持某物品.这并不检查任何物品上与它冲突的附魔。
原文: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。
-
equals
-
hashCode
public int hashCode() -
toString
-
registerEnchantment
注册一个附魔的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
-
getByKey
@Contract("null -> null") @Nullable public static @Nullable Enchantment getByKey(@Nullable @Nullable NamespacedKey key) 通过指定键值获取附魔.原文: Gets the Enchantment at the specified key
- 参数:
key
- 附魔键值key- 返回:
- 返回该key所对应的附魔,要是没有所对应的的附魔则返回null.
-
getByName
@Deprecated @Contract("null -> null") @Nullable public static @Nullable Enchantment getByName(@Nullable @Nullable String name) 已过时。这些附魔的命名简直糟透了,建议使用getByKey(org.bukkit.NamespacedKey)
.以指定名称获取附魔.原文: Gets the Enchantment at the specified name
- 参数:
name
- 名称- 返回:
- 返回该名称所对应的附魔,要是没有所对应的的附魔则返回null.
-
values
得到所有已经注册了的附魔(Enchantment
).原文: Gets an array of all the registered
Enchantment
s- 返回:
- 一个包含所有已注册附魔的数组
-
getByKey(org.bukkit.NamespacedKey)
.