public class EnchantmentWrapper extends Enchantment
Enchantment
sARROW_DAMAGE, ARROW_FIRE, ARROW_INFINITE, ARROW_KNOCKBACK, BINDING_CURSE, CHANNELING, DAMAGE_ALL, DAMAGE_ARTHROPODS, DAMAGE_UNDEAD, DEPTH_STRIDER, DIG_SPEED, DURABILITY, FIRE_ASPECT, FROST_WALKER, IMPALING, KNOCKBACK, LOOT_BONUS_BLOCKS, LOOT_BONUS_MOBS, LOYALTY, LUCK, LURE, MENDING, MULTISHOT, OXYGEN, PIERCING, PROTECTION_ENVIRONMENTAL, PROTECTION_EXPLOSIONS, PROTECTION_FALL, PROTECTION_FIRE, PROTECTION_PROJECTILE, QUICK_CHARGE, RIPTIDE, SILK_TOUCH, SOUL_SPEED, SWEEPING_EDGE, THORNS, VANISHING_CURSE, WATER_WORKER
Constructor and Description |
---|
EnchantmentWrapper(@NotNull String name) |
Modifier and Type | Method and Description |
---|---|
boolean |
canEnchantItem(@NotNull ItemStack item)
Checks if this Enchantment may be applied to the given
ItemStack . |
boolean |
conflictsWith(@NotNull Enchantment other)
Check if this enchantment conflicts with another enchantment.
|
net.kyori.adventure.text.Component |
displayName(int level)
Get the name of the enchantment with its applied level.
|
Set<EquipmentSlot> |
getActiveSlots()
Gets the equipment slots where this enchantment is considered "active".
|
float |
getDamageIncrease(int level,
EntityCategory entityCategory)
Gets the damage increase as a result of the level and entity category specified
|
@NotNull Enchantment |
getEnchantment()
Gets the enchantment bound to this wrapper
|
@NotNull EnchantmentTarget |
getItemTarget()
Gets the type of
ItemStack that may fit this Enchantment. |
int |
getMaxLevel()
Gets the maximum level that this Enchantment may become.
|
@NotNull String |
getName()
Gets the unique name of this enchantment
|
EnchantmentRarity |
getRarity()
Gets the rarity of this enchantment.
|
int |
getStartLevel()
Gets the level that this Enchantment should start at
|
boolean |
isCursed()
Checks if this enchantment is a cursed enchantment
Cursed enchantments are found the same way treasure enchantments are |
boolean |
isDiscoverable()
Checks if this enchantment can be found in an enchanting table
or use to enchant items generated by loot tables.
|
boolean |
isTradeable()
Checks if this enchantment can be found in villager trades.
|
boolean |
isTreasure()
Checks if this enchantment is a treasure enchantment.
|
equals, getByKey, getByName, getKey, hashCode, isAcceptingRegistrations, registerEnchantment, stopAcceptingRegistrations, toString, values
@NotNull public @NotNull Enchantment getEnchantment()
public int getMaxLevel()
Enchantment
getMaxLevel
in class Enchantment
public int getStartLevel()
Enchantment
getStartLevel
in class Enchantment
@NotNull public @NotNull EnchantmentTarget getItemTarget()
Enchantment
ItemStack
that may fit this Enchantment.getItemTarget
in class Enchantment
public boolean canEnchantItem(@NotNull @NotNull ItemStack item)
Enchantment
ItemStack
.
This does not check if it conflicts with any enchantments already applied to the item.
canEnchantItem
in class Enchantment
item
- Item to test@NotNull public @NotNull String getName()
Enchantment
getName
in class Enchantment
public boolean isTreasure()
Enchantment
isTreasure
in class Enchantment
public boolean isCursed()
Enchantment
isCursed
in class Enchantment
public boolean conflictsWith(@NotNull @NotNull Enchantment other)
Enchantment
conflictsWith
in class Enchantment
other
- The enchantment to check against@NotNull public net.kyori.adventure.text.Component displayName(int level)
Enchantment
If the given level
is either less than the Enchantment.getStartLevel()
or greater than the Enchantment.getMaxLevel()
,
the level may not be shown in the numeral format one may otherwise expect.
displayName
in class Enchantment
level
- the level of the enchantment to showlevel
appliedpublic boolean isTradeable()
Enchantment
isTradeable
in class Enchantment
public boolean isDiscoverable()
Enchantment
isDiscoverable
in class Enchantment
@NotNull public EnchantmentRarity getRarity()
Enchantment
getRarity
in class Enchantment
public float getDamageIncrease(int level, @NotNull EntityCategory entityCategory)
Enchantment
getDamageIncrease
in class Enchantment
level
- the level of enchantmententityCategory
- the category of entity@NotNull public Set<EquipmentSlot> getActiveSlots()
Enchantment
getActiveSlots
in class Enchantment
Copyright © 2021. All rights reserved.