public class ItemUtil extends Object
构造器和说明 |
---|
ItemUtil(SXAttribute plugin)
加载NBT反射类
此类所附加的nbt均带有插件名
|
限定符和类型 | 方法和说明 |
---|---|
void |
clearAttribute(ItemStack item)
清除物品默认属性标签
|
void |
clearAttribute(Player player)
清除物品标签
|
String |
getAllNBT(ItemStack item)
获取全部NBT数据
|
ItemStack |
getItemStack(String itemName,
String id,
List<String> itemLore,
List<String> itemFlagList,
Boolean unbreakable,
String color,
String skullName)
快速生成物品
|
String |
getNBT(ItemStack item,
String key)
获取物品NBT数据
|
List<String> |
getNBTList(ItemStack item,
String key)
设置物品NBT数据 List
|
boolean |
isNBT(ItemStack item,
String key)
判断是否有物品NBT数据
|
void |
removeAttribute(Player player)
回复物品默认标签
|
boolean |
removeNBT(ItemStack item,
String key)
清除指定 SX设置的nbt
|
ItemStack |
setAttackSpeed(ItemStack item,
double... speed)
设置物品攻击速度
|
ItemStack |
setNBT(ItemStack item,
String key,
String value)
设置物品NBT数据
|
ItemStack |
setNBTList(ItemStack item,
String key,
List<String> list)
设置物品NBT数据 List 会被设置ItemMeta
|
public ItemUtil(SXAttribute plugin) throws NoSuchMethodException, ClassNotFoundException
plugin
- SXAttributeNoSuchMethodException
- NoSuchMethodExceptionClassNotFoundException
- ClassNotFoundExceptionpublic void clearAttribute(Player player)
player
- Playerpublic ItemStack setAttackSpeed(ItemStack item, double... speed)
item
- ItemStackspeed
- double[]public void clearAttribute(ItemStack item)
item
- ItemStackpublic void removeAttribute(Player player)
player
- Playerpublic ItemStack setNBT(ItemStack item, String key, String value)
item
- ItemStackkey
- Stringvalue
- Stringpublic ItemStack setNBTList(ItemStack item, String key, List<String> list)
item
- ItemStackkey
- Stringlist
- Listpublic String getNBT(ItemStack item, String key)
item
- ItemStackkey
- Stringpublic List<String> getNBTList(ItemStack item, String key)
item
- ItemStackkey
- Stringpublic boolean isNBT(ItemStack item, String key)
item
- ItemStackkey
- Stringpublic boolean removeNBT(ItemStack item, String key)
item
- ItemStackkey
- Stringpublic ItemStack getItemStack(String itemName, String id, List<String> itemLore, List<String> itemFlagList, Boolean unbreakable, String color, String skullName)
itemName
- Stringid
- StringitemLore
- ListitemFlagList
- Listunbreakable
- Booleancolor
- StringskullName
- String