public class EnchantmentHelpers
extends java.lang.Object
| Constructor and Description |
|---|
EnchantmentHelpers() |
| Modifier and Type | Method and Description |
|---|---|
static int |
doesEnchantApply(net.minecraft.item.ItemStack itemStack,
int enchantID)
Checks if an itemStack has a certain enchantment.
|
static int |
getEnchantmentID(net.minecraft.item.ItemStack itemStack,
int enchantmentListID)
Returns the id of an enchantment given an itemStack and the list id
of the enchantment in the enchantmentlist (see doesEnchantApply() to get
the id in the enchantmentlist)
|
static int |
getEnchantmentLevel(net.minecraft.item.ItemStack itemStack,
int enchantmentListID)
Returns the level of an enchantment given an itemStack and the list id
of the enchantment in the enchantmentlist (see doesEnchantApply() to get
the id in the enchantmentlist)
|
static void |
setEnchantmentLevel(net.minecraft.item.ItemStack itemStack,
net.minecraft.enchantment.Enchantment enchantment,
int level)
Sets the level of an enchantment given an itemStack and the id
of the enchantment in the enchantmentlist (see doesEnchantApply() to get
the id in the enchantmentlist)
Will clear the enchantment if the new level <= 0
|
static void |
setEnchantmentLevel(net.minecraft.item.ItemStack itemStack,
int enchantmentListID,
int level)
Sets the level of an enchantment given an itemStack and the id
of the enchantment in the enchantmentlist (see doesEnchantApply() to get
the id in the enchantmentlist)
Will clear the enchantment if the new level <= 0
|
public static int doesEnchantApply(net.minecraft.item.ItemStack itemStack,
int enchantID)
itemStack - The itemStack to check.enchantID - The Enchantment to compare.public static int getEnchantmentLevel(net.minecraft.item.ItemStack itemStack,
int enchantmentListID)
itemStack - The itemStack which contains the enchanted itemenchantmentListID - The id of the enchantment in the enchantment listpublic static int getEnchantmentID(net.minecraft.item.ItemStack itemStack,
int enchantmentListID)
itemStack - The itemStack which contains the enchanted itemenchantmentListID - The id of the enchantment in the enchantment listpublic static void setEnchantmentLevel(net.minecraft.item.ItemStack itemStack,
int enchantmentListID,
int level)
itemStack - The itemStack which contains the enchanted itemenchantmentListID - The id of the enchantment in the enchantment listlevel - The new level of the enchantment on the given itempublic static void setEnchantmentLevel(net.minecraft.item.ItemStack itemStack,
net.minecraft.enchantment.Enchantment enchantment,
int level)
itemStack - The itemStack which contains the enchanted itemenchantment - The enchantmentlevel - The new level of the enchantment on the given item