Class McItemStack
java.lang.Object
com.shanebeestudios.nms.api.world.item.McItemStack
Wrapper for Minecraft ItemStack
Provides easy-to-use mapped methods for ItemStacks
-
Method Summary
Modifier and TypeMethodDescriptionstatic @NotNull McItemStack
empty()
Get an empty ItemStack wrappedGet as a copiedBukkit ItemStack
Get as a mirroredBukkit ItemStack
float
getDestroySpeed
(Block bukkitBlock) Get the destroy speed of this item based on a specificBlock
net.minecraft.world.item.Item
getItem()
Get the Item of this ItemStacknet.minecraft.world.item.ItemStack
Get Minecraft ItemStack of this wrapperGet a wrapped version of the Item of this ItemStackList
<net.kyori.adventure.text.Component> getTooltipLines
(Player player, boolean advanced) Get the lines of an ItemStack's tooltips asComponents
getTooltipLinesAsStrings
(Player player, boolean advanced) Get the lines of an ItemStack's tooltips as stringsboolean
Check if ItemStack is a damageable itemstatic @NotNull McItemStack
wrap
(@NotNull net.minecraft.world.item.ItemStack itemStack) Wrap an NMS ItemStack to use easy to use methodsstatic @NotNull McItemStack
Wrap a Bukkit ItemStack to use easy to use methods
-
Method Details
-
wrap
@NotNull public static @NotNull McItemStack wrap(@NotNull @NotNull net.minecraft.world.item.ItemStack itemStack) Wrap an NMS ItemStack to use easy to use methods- Parameters:
itemStack
- NMS ItemStack to wrap- Returns:
- Wrapped ItemStack
-
wrap
Wrap a Bukkit ItemStack to use easy to use methods- Parameters:
bukkitItemStack
- Bukkit ItemStack to wrap- Returns:
- Wrapped ItemStack
-
empty
Get an empty ItemStack wrapped- Returns:
- Wrapped empty ItemStack
-
getItemStack
public net.minecraft.world.item.ItemStack getItemStack()Get Minecraft ItemStack of this wrapper- Returns:
- ItemStack
-
getItemWrapper
Get a wrapped version of the Item of this ItemStack- Returns:
- Wrapped Item
-
getItem
public net.minecraft.world.item.Item getItem()Get the Item of this ItemStack- Returns:
- Item of this ItemStack
-
getDestroySpeed
Get the destroy speed of this item based on a specificBlock
- Parameters:
bukkitBlock
- Block to test for speed- Returns:
- Speed based on block
-
isDamageableItem
public boolean isDamageableItem()Check if ItemStack is a damageable item- Returns:
- True if damageable else false
-
getAsBukkitMirror
Get as a mirroredBukkit ItemStack
- Returns:
- Mirrored Bukkit ItemStack
-
getAsBukkitCopy
Get as a copiedBukkit ItemStack
- Returns:
- Copied Bukkit ItemStack
-
getTooltipLinesAsStrings
Get the lines of an ItemStack's tooltips as strings- Parameters:
player
- Player holding Itemadvanced
- Whether to show advanced tooltips or not- Returns:
- List of strings for tooltips
-
getTooltipLines
Get the lines of an ItemStack's tooltips asComponents
- Parameters:
player
- Player holding Itemadvanced
- Whether to show advanced tooltips or not- Returns:
- List of Components for tooltips
-