public abstract class Item extends Object implements Cloneable
| Constructor and Description |
|---|
Item(Identifier id) |
| Modifier and Type | Method and Description |
|---|---|
static void |
addCreativeItem(Item item) |
void |
addEnchantment(Enchantment... enchantments) |
Item |
addTag(com.nukkitx.nbt.NbtMap tag) |
boolean |
canBeActivated() |
boolean |
canBePlaced() |
boolean |
canDestroy(Identifier identifier) |
boolean |
canPlaceOn(Identifier identifier) |
static void |
clearCreativeItems() |
Item |
clearCustomName() |
Item |
clone() |
com.nukkitx.nbt.NbtMap |
createTag() |
void |
decrementCount() |
void |
decrementCount(int amount) |
boolean |
deepEquals(Item item)
Deprecated.
|
boolean |
deepEquals(Item item,
boolean checkDamage)
Deprecated.
|
boolean |
deepEquals(Item item,
boolean checkDamage,
boolean checkCompound)
Deprecated.
|
boolean |
equals(Item item,
boolean checkDamage) |
boolean |
equals(Item that,
boolean checkDamage,
boolean checkCompound) |
boolean |
equals(Object item) |
boolean |
equalsExact(Item other)
Returns whether the specified item stack has the same ID, damage, NBT and count as this item stack.
|
static Item |
fromJson(Map<String,Object> data) |
static Item |
fromNetwork(com.nukkitx.protocol.bedrock.data.inventory.ItemData itemData) |
static Item |
fromString(String str) |
static Item[] |
fromStringMultiple(String str) |
static Item |
get(BlockState blockState) |
static Item |
get(BlockState blockState,
int count) |
static Item |
get(Identifier id) |
static Item |
get(Identifier id,
int meta) |
static Item |
get(Identifier id,
int meta,
int count) |
static Item |
get(Identifier id,
int meta,
int count,
com.nukkitx.nbt.NbtMap tag) |
static Item |
get(int id)
Deprecated.
|
static Item |
get(int id,
int meta)
Deprecated.
|
static Item |
get(int id,
int meta,
int count)
Deprecated.
|
static Item |
get(int id,
int meta,
int count,
com.nukkitx.nbt.NbtMap tags)
Deprecated.
|
int |
getArmorPoints() |
int |
getAttackDamage() |
BlockState |
getBlock() |
int |
getCount() |
static Item |
getCreativeItem(int index) |
static int |
getCreativeItemIndex(Item item) |
static ArrayList<Item> |
getCreativeItems() |
String |
getCustomName() |
int |
getDestroySpeed(BlockState blockState,
Player player) |
int |
getEnchantAbility() |
Enchantment |
getEnchantment(int id) |
Enchantment |
getEnchantment(short id) |
Enchantment[] |
getEnchantments() |
Short |
getFuelTime() |
Identifier |
getId() |
String[] |
getLore() |
int |
getMaxDurability() |
int |
getMaxStackSize() |
int |
getMeta() |
String |
getName() |
int |
getNetworkId() |
com.nukkitx.nbt.NbtMap |
getTag() |
int |
getTier() |
int |
getToughness() |
boolean |
hasCustomName() |
boolean |
hasEnchantments() |
boolean |
hasMeta() |
boolean |
hasNbtMap() |
void |
incrementCount() |
void |
incrementCount(int amount) |
static void |
initCreativeItems() |
boolean |
isArmor() |
boolean |
isAxe() |
boolean |
isBoots() |
boolean |
isChestplate() |
static boolean |
isCreativeItem(Item item) |
boolean |
isHelmet() |
boolean |
isHoe() |
boolean |
isLeggings() |
boolean |
isNull() |
boolean |
isPickaxe() |
boolean |
isShears() |
boolean |
isShovel() |
boolean |
isSword() |
boolean |
isTool() |
boolean |
isUnbreakable() |
void |
loadAdditionalData(com.nukkitx.nbt.NbtMap tag) |
boolean |
onActivate(Level level,
Player player,
Block block,
Block target,
Direction face,
com.nukkitx.math.vector.Vector3f clickPos) |
boolean |
onClickAir(Player player,
com.nukkitx.math.vector.Vector3f directionVector)
Called when a player uses the item on air, for example throwing a projectile.
|
protected void |
onMetaChange(int newMeta) |
boolean |
onRelease(Player player,
int ticksUsed) |
boolean |
onUse(Player player,
int ticksUsed) |
static void |
removeCreativeItem(Item item) |
void |
saveAdditionalData(com.nukkitx.nbt.NbtMapBuilder tag) |
void |
setCount(int count) |
Item |
setCustomName(String name) |
Item |
setLore(Collection<String> lines) |
Item |
setLore(String... lines) |
void |
setMeta(int meta) |
void |
setTag(com.nukkitx.nbt.NbtMap tag) |
com.nukkitx.protocol.bedrock.data.inventory.ItemData |
toNetwork() |
static com.nukkitx.protocol.bedrock.data.inventory.ItemData[] |
toNetwork(Item[] items) |
static com.nukkitx.protocol.bedrock.data.inventory.ItemData[] |
toNetwork(List<Item> items) |
String |
toString() |
boolean |
useOn(Block block) |
boolean |
useOn(Entity entity) |
public Item(Identifier id)
public static void initCreativeItems()
public boolean canBeActivated()
public static void clearCreativeItems()
public static void addCreativeItem(Item item)
public static void removeCreativeItem(Item item)
public static boolean isCreativeItem(Item item)
public static Item getCreativeItem(int index)
public static int getCreativeItemIndex(Item item)
public static Item get(BlockState blockState)
public static Item get(BlockState blockState, int count)
public static Item get(Identifier id)
public static Item get(Identifier id, int meta)
public static Item get(Identifier id, int meta, int count)
public static Item get(Identifier id, int meta, int count, com.nukkitx.nbt.NbtMap tag)
@Deprecated public static Item get(int id)
@Deprecated public static Item get(int id, int meta)
@Deprecated public static Item get(int id, int meta, int count)
@Deprecated public static Item get(int id, int meta, int count, com.nukkitx.nbt.NbtMap tags)
public boolean hasMeta()
public static com.nukkitx.protocol.bedrock.data.inventory.ItemData[] toNetwork(List<Item> items)
public static com.nukkitx.protocol.bedrock.data.inventory.ItemData[] toNetwork(Item[] items)
public static Item fromNetwork(com.nukkitx.protocol.bedrock.data.inventory.ItemData itemData)
public void loadAdditionalData(com.nukkitx.nbt.NbtMap tag)
public void saveAdditionalData(com.nukkitx.nbt.NbtMapBuilder tag)
public com.nukkitx.nbt.NbtMap createTag()
public boolean canPlaceOn(Identifier identifier)
public boolean canDestroy(Identifier identifier)
public boolean hasNbtMap()
public com.nukkitx.nbt.NbtMap getTag()
public Enchantment getEnchantment(int id)
public void setTag(com.nukkitx.nbt.NbtMap tag)
public Item addTag(com.nukkitx.nbt.NbtMap tag)
public boolean hasEnchantments()
public Enchantment getEnchantment(short id)
public void addEnchantment(Enchantment... enchantments)
public Enchantment[] getEnchantments()
public boolean hasCustomName()
public Item clearCustomName()
public void decrementCount()
public void decrementCount(int amount)
public void incrementCount()
public void incrementCount(int amount)
public int getCount()
public void setCount(int count)
public boolean isNull()
public final String getName()
public final boolean canBePlaced()
public BlockState getBlock()
public Identifier getId()
public String[] getLore()
public Item setLore(Collection<String> lines)
public int getMaxStackSize()
public final Short getFuelTime()
public boolean useOn(Entity entity)
public boolean useOn(Block block)
public boolean isTool()
public int getMaxDurability()
public int getTier()
public boolean isPickaxe()
public boolean isAxe()
public boolean isSword()
public boolean isShovel()
public boolean isHoe()
public boolean isShears()
public boolean isArmor()
public boolean isHelmet()
public boolean isChestplate()
public boolean isLeggings()
public boolean isBoots()
public int getEnchantAbility()
public int getAttackDamage()
public int getArmorPoints()
public int getToughness()
public boolean isUnbreakable()
public boolean onUse(Player player, int ticksUsed)
public boolean onRelease(Player player, int ticksUsed)
public int getMeta()
public int getDestroySpeed(BlockState blockState, Player player)
public boolean onActivate(Level level, Player player, Block block, Block target, Direction face, com.nukkitx.math.vector.Vector3f clickPos)
public boolean onClickAir(Player player, com.nukkitx.math.vector.Vector3f directionVector)
player - playerdirectionVector - directionpublic final boolean equals(Item item, boolean checkDamage)
public void setMeta(int meta)
public final boolean equalsExact(Item other)
other - item@Deprecated public final boolean deepEquals(Item item)
@Deprecated public final boolean deepEquals(Item item, boolean checkDamage)
@Deprecated public final boolean deepEquals(Item item, boolean checkDamage, boolean checkCompound)
protected void onMetaChange(int newMeta)
public final boolean equals(Item that, boolean checkDamage, boolean checkCompound)
public int getNetworkId()
public com.nukkitx.protocol.bedrock.data.inventory.ItemData toNetwork()
Copyright © 2020. All rights reserved.