Class PaperItemStack

java.lang.Object
net.tnemc.item.paper.PaperItemStack
All Implemented Interfaces:
Cloneable, AbstractItemStack<org.bukkit.inventory.ItemStack>

public class PaperItemStack extends Object implements AbstractItemStack<org.bukkit.inventory.ItemStack>
PaperItemStack
Since:
0.1.7.5
Author:
creatorfromhell
  • Constructor Details

  • Method Details

    • of

      public PaperItemStack of(String material, int amount)
      Creates a new item stack with the specified material and amount.
      Specified by:
      of in interface AbstractItemStack<org.bukkit.inventory.ItemStack>
      Parameters:
      material - The material of the item.
      amount - The number of items in the stack.
      Returns:
      A new item stack instance.
    • of

      public PaperItemStack of(org.bukkit.inventory.ItemStack locale)
      Creates a new item stack from a locale-specific object.
      Specified by:
      of in interface AbstractItemStack<org.bukkit.inventory.ItemStack>
      Parameters:
      locale - The locale-specific representation.
      Returns:
      A new item stack instance.
    • of

      public PaperItemStack of(org.json.simple.JSONObject json) throws org.json.simple.parser.ParseException
      Creates a new item stack from a JSON representation.
      Specified by:
      of in interface AbstractItemStack<org.bukkit.inventory.ItemStack>
      Parameters:
      json - The JSON object containing item stack data.
      Returns:
      A new item stack instance.
      Throws:
      org.json.simple.parser.ParseException - If the JSON structure is invalid.
    • flags

      public PaperItemStack flags(List<String> flags)
      Sets the item flags.
      Specified by:
      flags in interface AbstractItemStack<org.bukkit.inventory.ItemStack>
      Parameters:
      flags - A list of flags to apply to the item.
      Returns:
      The updated item stack instance.
    • loreComponent

      public PaperItemStack loreComponent(List<net.kyori.adventure.text.Component> lore)
      Sets the lore (descriptive text) of the item stack.
      Specified by:
      loreComponent in interface AbstractItemStack<org.bukkit.inventory.ItemStack>
      Parameters:
      lore - A list of components representing the lore.
      Returns:
      The updated item stack instance.
    • enchant

      public PaperItemStack enchant(String enchantment, int level)
      Adds an enchantment to the item stack.
      Specified by:
      enchant in interface AbstractItemStack<org.bukkit.inventory.ItemStack>
      Parameters:
      enchantment - The enchantment name.
      level - The level of the enchantment.
      Returns:
      The updated item stack instance.
    • enchant

      public PaperItemStack enchant(Map<String,Integer> enchantments)
      Adds multiple enchantments to the item stack.
      Specified by:
      enchant in interface AbstractItemStack<org.bukkit.inventory.ItemStack>
      Parameters:
      enchantments - A map of enchantment names and levels.
      Returns:
      The updated item stack instance.
    • enchant

      public PaperItemStack enchant(List<String> enchantments)
      Adds enchantments to the item stack by name.
      Specified by:
      enchant in interface AbstractItemStack<org.bukkit.inventory.ItemStack>
      Parameters:
      enchantments - A list of enchantment names.
      Returns:
      The updated item stack instance.
    • material

      public String material()
      Returns the material of the item stack.
      Specified by:
      material in interface AbstractItemStack<org.bukkit.inventory.ItemStack>
      Returns:
      The material of the item stack.
    • material

      public PaperItemStack material(String material)
      Sets the material of the item stack.
      Specified by:
      material in interface AbstractItemStack<org.bukkit.inventory.ItemStack>
      Parameters:
      material - The material name.
      Returns:
      The updated item stack instance.
    • amount

      public int amount()
      The quantity of the item stack.
      Specified by:
      amount in interface AbstractItemStack<org.bukkit.inventory.ItemStack>
      Returns:
      the quantity of the item stack.
    • amount

      public PaperItemStack amount(int amount)
      Sets the quantity of the item stack.
      Specified by:
      amount in interface AbstractItemStack<org.bukkit.inventory.ItemStack>
      Parameters:
      amount - The number of items in the stack.
      Returns:
      The updated item stack instance.
    • slot

      public int slot()
      Represents the inventory slot of the item stack.
      Specified by:
      slot in interface AbstractItemStack<org.bukkit.inventory.ItemStack>
      Returns:
      the inventory slot of the item stack.
    • slot

      public PaperItemStack slot(int slot)
      Sets the inventory slot of the item stack.
      Specified by:
      slot in interface AbstractItemStack<org.bukkit.inventory.ItemStack>
      Parameters:
      slot - The slot index.
      Returns:
      The updated item stack instance.
    • debug

      public PaperItemStack debug(boolean debug)
      Enables or disables debug mode for the item stack.
      Specified by:
      debug in interface AbstractItemStack<org.bukkit.inventory.ItemStack>
      Parameters:
      debug - True to enable, false to disable.
      Returns:
      The updated item stack instance.
    • cacheLocale

      public org.bukkit.inventory.ItemStack cacheLocale()
    • updateCache

      public void updateCache(org.bukkit.inventory.ItemStack localeStack)
    • applyPersistentHolder

      public PaperItemStack applyPersistentHolder(PersistentDataHolder newHolder, boolean replaceOld)
      Replaces the persistent data holder for the item stack.
      Specified by:
      applyPersistentHolder in interface AbstractItemStack<org.bukkit.inventory.ItemStack>
      Parameters:
      newHolder - The new persistent data holder.
      replaceOld - True to replace existing data, false to merge.
      Returns:
      The updated item stack instance.
      Since:
      0.2.0.0
    • flags

      public List<String> flags()
      Retrieves the item flags.
      Specified by:
      flags in interface AbstractItemStack<org.bukkit.inventory.ItemStack>
      Returns:
      A list of flags applied to the item.
    • components

      public Map<String,SerialComponent<AbstractItemStack<org.bukkit.inventory.ItemStack>,org.bukkit.inventory.ItemStack>> components()
      Retrieves the components applied to the item stack.
      Specified by:
      components in interface AbstractItemStack<org.bukkit.inventory.ItemStack>
      Returns:
      A map of component types and their serialized representations.
      Since:
      0.2.0.0
    • persistentHolder

      Retrieves the persistent data holder for the item stack.
      Specified by:
      persistentHolder in interface AbstractItemStack<org.bukkit.inventory.ItemStack>
      Returns:
      The persistent data holder.
      Since:
      0.2.0.0
    • resetDirty

      public void resetDirty()
      Resets the dirty flag, indicating that the object's state has been synchronized with the database.
      Specified by:
      resetDirty in interface AbstractItemStack<org.bukkit.inventory.ItemStack>
    • markDirty

      public void markDirty()
      Marks the item stack as dirty, indicating changes have been made.
      Specified by:
      markDirty in interface AbstractItemStack<org.bukkit.inventory.ItemStack>
    • isDirty

      public boolean isDirty()
      Checks whether the object is dirty or has unsaved changes.
      Specified by:
      isDirty in interface AbstractItemStack<org.bukkit.inventory.ItemStack>
      Returns:
      true if the object is dirty, false otherwise
    • itemProvider

      public String itemProvider()
      This method returns a String representing the item provider.
      Specified by:
      itemProvider in interface AbstractItemStack<org.bukkit.inventory.ItemStack>
      Returns:
      the item provider as a String
      See Also:
    • setItemProvider

      public PaperItemStack setItemProvider(String itemProvider)
      Sets the item provider to be used for retrieving items.
      Specified by:
      setItemProvider in interface AbstractItemStack<org.bukkit.inventory.ItemStack>
      Parameters:
      itemProvider - the string representing the item provider to be set
    • providerItemID

      Retrieves the provider item ID associated with the current object.
      Specified by:
      providerItemID in interface AbstractItemStack<org.bukkit.inventory.ItemStack>
      Returns:
      The provider item ID of the object.
    • setProviderItemID

      public PaperItemStack setProviderItemID(String providerItemID)
      Sets the provider's item ID for the current item.
      Specified by:
      setProviderItemID in interface AbstractItemStack<org.bukkit.inventory.ItemStack>
      Parameters:
      providerItemID - the unique ID assigned by the provider for the item
    • provider

      public ItemProvider<org.bukkit.inventory.ItemStack> provider()
      This method is used to return an ItemProvider object.
      Specified by:
      provider in interface AbstractItemStack<org.bukkit.inventory.ItemStack>
      Returns:
      ItemProvider object representing the item provider.
    • toJSON

      public org.json.simple.JSONObject toJSON()
      Converts the object to a JSONObject representation.
      Specified by:
      toJSON in interface AbstractItemStack<org.bukkit.inventory.ItemStack>
      Returns:
      A JSONObject representing the object data.
    • attributeModifiers

      public PaperItemStack attributeModifiers(List<AttributeModifier> modifiers, boolean showInTooltip)
      Updates the attribute modifiers of the item stack.
      Specified by:
      attributeModifiers in interface AbstractItemStack<org.bukkit.inventory.ItemStack>
      Parameters:
      modifiers - a list of attribute modifiers
      showInTooltip - whether to display the modifiers in the tooltip
      Returns:
      the updated PaperItemStack instance
      Since:
      0.2.0.0
      See Also:
    • bannerPatterns

      Updates the banner patterns of the item stack.
      Specified by:
      bannerPatterns in interface AbstractItemStack<org.bukkit.inventory.ItemStack>
      Parameters:
      patterns - a list of pattern data
      Returns:
      the updated PaperItemStack instance
      Since:
      0.2.0.0
      See Also:
    • baseColor

      Updates the base color of the item stack.
      Specified by:
      baseColor in interface AbstractItemStack<org.bukkit.inventory.ItemStack>
      Parameters:
      color - the new base color
      Returns:
      the updated PaperItemStack instance
      Since:
      0.2.0.0
      See Also:
    • blocksAttacks

      public AbstractItemStack<org.bukkit.inventory.ItemStack> blocksAttacks(ItemDamage damage)
      Blocks attacks with the specified damage type using this item.
      Specified by:
      blocksAttacks in interface AbstractItemStack<org.bukkit.inventory.ItemStack>
      Parameters:
      damage - the type of damage to block attacks from
      Returns:
      an AbstractItemStack object representing the item after blocking attacks
      Since:
      0.2.0.0
      See Also:
    • breakSound

      public AbstractItemStack<org.bukkit.inventory.ItemStack> breakSound(String sound)
      Set the break sound for this item stack.
      Specified by:
      breakSound in interface AbstractItemStack<org.bukkit.inventory.ItemStack>
      Parameters:
      sound - the sound to be played when the item is broken
      Returns:
      the updated item stack object
      Since:
      0.2.0.0
      See Also:
    • bucketEntityData

      public PaperItemStack bucketEntityData(boolean noAI, boolean silent, boolean noGravity, boolean glowing, boolean invulnerable, float health, int age, int variant, long huntingCooldown, int bucketVariantTag, String type)
      Updates the bucket entity data of the item stack.
      Specified by:
      bucketEntityData in interface AbstractItemStack<org.bukkit.inventory.ItemStack>
      Parameters:
      noAI - whether the entity has AI disabled
      silent - whether the entity is silent
      noGravity - whether the entity is affected by gravity
      glowing - whether the entity is glowing
      invulnerable - whether the entity is invulnerable
      health - the health of the entity
      age - the age of the entity
      variant - the variant of the entity
      huntingCooldown - the hunting cooldown of the entity
      bucketVariantTag - the variant tag of the bucket
      type - the type of the entity
      Returns:
      the updated PaperItemStack instance
      Since:
      0.2.0.0
      See Also:
    • bundle

      public PaperItemStack bundle(Map<Integer,AbstractItemStack<org.bukkit.inventory.ItemStack>> items)
      Bundles a collection of AbstractItemStack instances into a single collection.
      Specified by:
      bundle in interface AbstractItemStack<org.bukkit.inventory.ItemStack>
      Parameters:
      items - A Map containing integer keys and AbstractItemStack values to be bundled.
      Returns:
      An AbstractItemStack instance that represents the bundled items.
      Since:
      0.2.0.0
      See Also:
    • canBreak

      Updates the blocks that the item stack can break.
      Specified by:
      canBreak in interface AbstractItemStack<org.bukkit.inventory.ItemStack>
      Parameters:
      predicates - a list of block predicates
      Returns:
      the updated PaperItemStack instance
      Since:
      0.2.0.0
      See Also:
    • canPlaceOn

      Updates the blocks that the item stack can be placed on.
      Specified by:
      canPlaceOn in interface AbstractItemStack<org.bukkit.inventory.ItemStack>
      Parameters:
      predicates - a list of block predicates
      Returns:
      the updated PaperItemStack instance
      Since:
      0.2.0.0
      See Also:
    • consumable

      public PaperItemStack consumable(float consumeSeconds, String animation, String sound, boolean hasConsumeParticles, List<ComponentEffect> effects)
      Updates the consumable properties of the item stack.
      Specified by:
      consumable in interface AbstractItemStack<org.bukkit.inventory.ItemStack>
      Parameters:
      consumeSeconds - the time it takes to consume the item
      animation - the animation to display when consuming
      sound - the sound to play when consuming
      hasConsumeParticles - whether to show consume particles
      effects - a list of effects applied on consumption
      Returns:
      the updated PaperItemStack instance
      Since:
      0.2.0.0
      See Also:
    • container

      public PaperItemStack container(Map<Integer,AbstractItemStack<org.bukkit.inventory.ItemStack>> items)
      Constructs a container with the given map of items.
      Specified by:
      container in interface AbstractItemStack<org.bukkit.inventory.ItemStack>
      Parameters:
      items - a map of items where the key is the position of the item in the container and the value is the item
      Returns:
      an AbstractItemStack container with the specified items
      Since:
      0.2.0.0
      See Also:
    • customName

      public PaperItemStack customName(net.kyori.adventure.text.Component customName)
      Updates the custom name of the item stack.
      Specified by:
      customName in interface AbstractItemStack<org.bukkit.inventory.ItemStack>
      Parameters:
      customName - the custom name to set
      Returns:
      the updated PaperItemStack instance
      Since:
      0.2.0.0
      See Also:
    • damage

      public PaperItemStack damage(int damage)
      Updates the damage of the item stack.
      Specified by:
      damage in interface AbstractItemStack<org.bukkit.inventory.ItemStack>
      Parameters:
      damage - the damage value to set
      Returns:
      the updated PaperItemStack instance
      Since:
      0.2.0.0
      See Also:
    • damageResistant

      Updates the damage-resistant types of the item stack.
      Specified by:
      damageResistant in interface AbstractItemStack<org.bukkit.inventory.ItemStack>
      Parameters:
      types - a list of damage-resistant types
      Returns:
      the updated PaperItemStack instance
      Since:
      0.2.0.0
      See Also:
    • deathProtection

      Updates the death protection effects of the item stack.
      Specified by:
      deathProtection in interface AbstractItemStack<org.bukkit.inventory.ItemStack>
      Parameters:
      deathEffects - a list of death protection effects
      Returns:
      the updated PaperItemStack instance
      Since:
      0.2.0.0
      See Also:
    • dyedColor

      public PaperItemStack dyedColor(int rgb)
      Updates the dyed color of the item stack.
      Specified by:
      dyedColor in interface AbstractItemStack<org.bukkit.inventory.ItemStack>
      Parameters:
      rgb - the RGB color value to set
      Returns:
      the updated PaperItemStack instance
      Since:
      0.2.0.0
      See Also:
    • enchantable

      public PaperItemStack enchantable(int value)
      Updates the enchantability of the item stack.
      Specified by:
      enchantable in interface AbstractItemStack<org.bukkit.inventory.ItemStack>
      Parameters:
      value - the enchantability value to set
      Returns:
      the updated PaperItemStack instance
      Since:
      0.2.0.0
      See Also:
    • enchantmentGlintOverride

      public PaperItemStack enchantmentGlintOverride(boolean glintOverride)
      Updates the enchantment glint override of the item stack.
      Specified by:
      enchantmentGlintOverride in interface AbstractItemStack<org.bukkit.inventory.ItemStack>
      Parameters:
      glintOverride - whether the enchantment glint should be overridden
      Returns:
      the updated PaperItemStack instance
      Since:
      0.2.0.0
      See Also:
    • enchantments

      Updates the enchantments of the item stack.
      Specified by:
      enchantments in interface AbstractItemStack<org.bukkit.inventory.ItemStack>
      Parameters:
      levels - a map of enchantments and their levels
      Returns:
      the updated PaperItemStack instance
      Since:
      0.2.0.0
      See Also:
    • entityVariant

      public AbstractItemStack<org.bukkit.inventory.ItemStack> entityVariant(String entity, String variant)
      Generates an AbstractItemStack based on the given entity and variant.
      Specified by:
      entityVariant in interface AbstractItemStack<org.bukkit.inventory.ItemStack>
      Parameters:
      entity - the entity name to create the stack for
      variant - the variant of the entity
      Returns:
      an AbstractItemStack representing the entity with the specified variant
      Since:
      0.2.0.0
      See Also:
    • equip

      public PaperItemStack equip(String cameraKey, String equipSound, String modelKey, EquipSlot slot, boolean damageOnHurt, boolean dispensable, boolean swappable, boolean equipOnInteract, List<String> entities)
      Equips an item with specified parameters.
      Specified by:
      equip in interface AbstractItemStack<org.bukkit.inventory.ItemStack>
      Parameters:
      cameraKey - the key identifying the camera
      equipSound - the key identifying the equip sound
      modelKey - the key identifying the model
      slot - the slot in which the item should be equipped
      damageOnHurt - flag indicating if damage should be taken on hurt
      dispensable - flag indicating if the item is dispensable
      swappable - flag indicating if the item is swappable
      equipOnInteract - flag indicating if the item should be equipped on interact
      entities - a list of entities to be equipped
      Returns:
      an PaperItemStack object representing the equipped item
      Since:
      0.2.0.0
      See Also:
    • fireworkExplosion

      Updates the firework explosion properties of the item stack.
      Specified by:
      fireworkExplosion in interface AbstractItemStack<org.bukkit.inventory.ItemStack>
      Parameters:
      explosion - the explosion data to set
      Returns:
      the updated PaperItemStack instance
      Since:
      0.2.0.0
      See Also:
    • fireworks

      public PaperItemStack fireworks(byte flightDuration, List<ExplosionData> explosions)
      Updates the fireworks properties of the item stack.
      Specified by:
      fireworks in interface AbstractItemStack<org.bukkit.inventory.ItemStack>
      Parameters:
      flightDuration - the flight duration of the fireworks
      explosions - a list of explosion data
      Returns:
      the updated PaperItemStack instance
      Since:
      0.2.0.0
      See Also:
    • food

      public PaperItemStack food(boolean noHunger, float saturation, int nutrition)
      Updates the food properties of the item stack.
      Specified by:
      food in interface AbstractItemStack<org.bukkit.inventory.ItemStack>
      Parameters:
      noHunger - whether the item causes no hunger
      saturation - the saturation value
      nutrition - the nutrition value
      Returns:
      the updated PaperItemStack instance
      Since:
      0.2.0.0
      See Also:
    • gliderTag

      Updates the item stack to enable glider functionality.
      Specified by:
      gliderTag in interface AbstractItemStack<org.bukkit.inventory.ItemStack>
      Returns:
      the updated PaperItemStack instance
      Since:
      0.2.0.0
      See Also:
    • hideAdditionalTooltipTag

      Updates the item stack to hide additional tooltip.
      Specified by:
      hideAdditionalTooltipTag in interface AbstractItemStack<org.bukkit.inventory.ItemStack>
      Returns:
      the updated PaperItemStack instance
      Since:
      0.2.0.0
      See Also:
    • hideTooltipTag

      Updates the item stack to hide its tooltip.
      Specified by:
      hideTooltipTag in interface AbstractItemStack<org.bukkit.inventory.ItemStack>
      Returns:
      the updated PaperItemStack instance
      Since:
      0.2.0.0
      See Also:
    • instrument

      public PaperItemStack instrument(String soundEvent, int useDuration, int range)
      Updates the instrument properties of the item stack.
      Specified by:
      instrument in interface AbstractItemStack<org.bukkit.inventory.ItemStack>
      Parameters:
      soundEvent - the sound event identifier
      useDuration - the duration of the sound in ticks
      range - the range of the sound
      Returns:
      the updated PaperItemStack instance
      Since:
      0.2.0.0
      See Also:
    • intangibleProjectileTag

      Updates the item stack as an intangible projectile.
      Specified by:
      intangibleProjectileTag in interface AbstractItemStack<org.bukkit.inventory.ItemStack>
      Returns:
      the updated PaperItemStack instance
      Since:
      0.2.0.0
      See Also:
    • itemModel

      Updates the model properties of the item stack.
      Specified by:
      itemModel in interface AbstractItemStack<org.bukkit.inventory.ItemStack>
      Parameters:
      model - the model identifier
      Returns:
      the updated PaperItemStack instance
      Since:
      0.2.0.0
      See Also:
    • itemName

      public PaperItemStack itemName(net.kyori.adventure.text.Component itemName)
      Updates the name of the item stack.
      Specified by:
      itemName in interface AbstractItemStack<org.bukkit.inventory.ItemStack>
      Parameters:
      itemName - the name of the item
      Returns:
      the updated PaperItemStack instance
      Since:
      0.2.0.0
      See Also:
    • jukebox

      public PaperItemStack jukebox(String song, boolean showInTooltip)
      Updates the jukebox properties of the item stack.
      Specified by:
      jukebox in interface AbstractItemStack<org.bukkit.inventory.ItemStack>
      Parameters:
      song - the song identifier
      showInTooltip - whether to display the song in the tooltip
      Returns:
      the updated PaperItemStack instance
      Since:
      0.2.0.0
      See Also:
    • lodestoneTracker

      public PaperItemStack lodestoneTracker(String target, int[] pos, String dimension, boolean tracked)
      Updates the lodestone tracker properties of the item stack.
      Specified by:
      lodestoneTracker in interface AbstractItemStack<org.bukkit.inventory.ItemStack>
      Parameters:
      target - the target identifier
      pos - the position array
      dimension - the dimension identifier
      tracked - whether the lodestone is tracked
      Returns:
      the updated PaperItemStack instance
      Since:
      0.2.0.0
      See Also:
    • lore

      public PaperItemStack lore(List<net.kyori.adventure.text.Component> lore)
      Updates the lore of the item stack.
      Specified by:
      lore in interface AbstractItemStack<org.bukkit.inventory.ItemStack>
      Parameters:
      lore - a list of lore strings
      Returns:
      the updated PaperItemStack instance
      Since:
      0.2.0.0
      See Also:
    • mapColor

      public PaperItemStack mapColor(int mapColor)
      Updates the map color of the item stack.
      Specified by:
      mapColor in interface AbstractItemStack<org.bukkit.inventory.ItemStack>
      Parameters:
      mapColor - the map color value
      Returns:
      the updated PaperItemStack instance
      Since:
      0.2.0.0
      See Also:
    • mapId

      public PaperItemStack mapId(int mapId)
      Updates the map ID of the item stack.
      Specified by:
      mapId in interface AbstractItemStack<org.bukkit.inventory.ItemStack>
      Parameters:
      mapId - the map ID value
      Returns:
      the updated PaperItemStack instance
      Since:
      0.2.0.0
      See Also:
    • maxDamage

      public PaperItemStack maxDamage(int maxDamage)
      Updates the maximum damage of the item stack.
      Specified by:
      maxDamage in interface AbstractItemStack<org.bukkit.inventory.ItemStack>
      Parameters:
      maxDamage - the maximum damage value
      Returns:
      the updated PaperItemStack instance
      Since:
      0.2.0.0
      See Also:
    • maxStackSize

      public PaperItemStack maxStackSize(int maxStackSize)
      Updates the maximum stack size of the item stack.
      Specified by:
      maxStackSize in interface AbstractItemStack<org.bukkit.inventory.ItemStack>
      Parameters:
      maxStackSize - the maximum stack size value
      Returns:
      the updated PaperItemStack instance
      Since:
      0.2.0.0
      See Also:
    • modelData

      public PaperItemStack modelData(List<String> colours, List<Float> floats, List<Boolean> flags, List<String> strings)
      Updates the model data of the item stack.
      Specified by:
      modelData in interface AbstractItemStack<org.bukkit.inventory.ItemStack>
      Parameters:
      colours - a list of color strings
      floats - a list of float values
      flags - a list of boolean flags
      strings - a list of string identifiers
      Returns:
      the updated PaperItemStack instance
      Since:
      0.2.0.0
      See Also:
    • modelDataOld

      public AbstractItemStack<org.bukkit.inventory.ItemStack> modelDataOld(int customModelData)
      Deprecated.
      Since MC 1.21.3 Use ItemModelComponent and ModelDataComponent.
      Retrieves the model data for a custom item stack.
      Specified by:
      modelDataOld in interface AbstractItemStack<org.bukkit.inventory.ItemStack>
      Parameters:
      customModelData - the custom model data to retrieve
      Returns:
      an AbstractItemStack with the specified custom model data
      Since:
      0.2.0.0
      See Also:
    • noteBlockSound

      Updates the note block sound of the item stack.
      Specified by:
      noteBlockSound in interface AbstractItemStack<org.bukkit.inventory.ItemStack>
      Parameters:
      soundId - the identifier of the sound
      Returns:
      the updated PaperItemStack instance
      Since:
      0.2.0.0
      See Also:
    • ominousBottleAmplifier

      public PaperItemStack ominousBottleAmplifier(int amplifier)
      Updates the ominous bottle amplifier of the item stack.
      Specified by:
      ominousBottleAmplifier in interface AbstractItemStack<org.bukkit.inventory.ItemStack>
      Parameters:
      amplifier - the amplifier value
      Returns:
      the updated PaperItemStack instance
      Since:
      0.2.0.0
      See Also:
    • potDecorations

      public PaperItemStack potDecorations(List<String> decorations)
      Updates the pot decorations of the item stack.
      Specified by:
      potDecorations in interface AbstractItemStack<org.bukkit.inventory.ItemStack>
      Parameters:
      decorations - a list of decorations
      Returns:
      the updated PaperItemStack instance
      Since:
      0.2.0.0
      See Also:
    • potionContents

      public PaperItemStack potionContents(String potionId, int customColor, String customName, List<EffectInstance> effects)
      Updates the potion contents of the item stack.
      Specified by:
      potionContents in interface AbstractItemStack<org.bukkit.inventory.ItemStack>
      Parameters:
      potionId - the ID of the potion
      customColor - the custom color of the potion
      customName - the custom name of the potion
      effects - a list of effect instances
      Returns:
      the updated PaperItemStack instance
      Since:
      0.2.0.0
      See Also:
    • potionDuration

      public PaperItemStack potionDuration(float potionDuration)
      Sets the duration of a potion effect for the item stack. Since MC Snapshot 25w02a.
      Specified by:
      potionDuration in interface AbstractItemStack<org.bukkit.inventory.ItemStack>
      Parameters:
      potionDuration - the duration of the potion effect in seconds
      Returns:
      the modified PaperItemStack object with the updated potion duration
      Since:
      0.2.0.0
      See Also:
    • profile

      Profiles the given SkullProfile to the PaperItemStack object.
      Specified by:
      profile in interface AbstractItemStack<org.bukkit.inventory.ItemStack>
      Parameters:
      profile - the SkullProfile to be assigned
      Returns:
      an PaperItemStack object with the provided profile
    • providesPattern

      public AbstractItemStack<org.bukkit.inventory.ItemStack> providesPattern(String patternTag)
      Retrieve an AbstractItemStack object that provides a specific pattern identified by the patternTag.
      Specified by:
      providesPattern in interface AbstractItemStack<org.bukkit.inventory.ItemStack>
      Parameters:
      patternTag - The unique identifier of the pattern to be provided.
      Returns:
      An AbstractItemStack object that provides the specified pattern.
      Since:
      0.2.0.0
      See Also:
    • providesTrim

      public AbstractItemStack<org.bukkit.inventory.ItemStack> providesTrim(String material)
      Applies the specified trim material
      Specified by:
      providesTrim in interface AbstractItemStack<org.bukkit.inventory.ItemStack>
      Parameters:
      material - the trim material
      Returns:
      an AbstractItemStack object representing the trimmed material
      Since:
      0.2.0.0
      See Also:
    • rarity

      public PaperItemStack rarity(String rarity)
      Updates the rarity of the item stack.
      Specified by:
      rarity in interface AbstractItemStack<org.bukkit.inventory.ItemStack>
      Parameters:
      rarity - the rarity value
      Returns:
      the updated PaperItemStack instance
      Since:
      0.2.0.0
      See Also:
    • recipes

      public PaperItemStack recipes(List<String> recipes)
      Updates the recipes of the item stack.
      Specified by:
      recipes in interface AbstractItemStack<org.bukkit.inventory.ItemStack>
      Parameters:
      recipes - a list of recipe identifiers
      Returns:
      the updated PaperItemStack instance
      Since:
      0.2.0.0
      See Also:
    • repairable

      public PaperItemStack repairable(List<String> repairItems)
      Updates the repairable items of the item stack.
      Specified by:
      repairable in interface AbstractItemStack<org.bukkit.inventory.ItemStack>
      Parameters:
      repairItems - a list of repair item identifiers
      Returns:
      the updated PaperItemStack instance
      Since:
      0.2.0.0
      See Also:
    • repairCost

      public PaperItemStack repairCost(int repairCost)
      Updates the repair cost of the item stack.
      Specified by:
      repairCost in interface AbstractItemStack<org.bukkit.inventory.ItemStack>
      Parameters:
      repairCost - the repair cost value
      Returns:
      the updated PaperItemStack instance
      Since:
      0.2.0.0
      See Also:
    • storedEnchantments

      Updates the stored enchantments of the item stack.
      Specified by:
      storedEnchantments in interface AbstractItemStack<org.bukkit.inventory.ItemStack>
      Parameters:
      enchantments - a map of enchantment names to their levels
      Returns:
      the updated PaperItemStack instance
      Since:
      0.2.0.0
      See Also:
    • suspiciousStewEffects

      public AbstractItemStack<org.bukkit.inventory.ItemStack> suspiciousStewEffects(List<EffectInstance> effects)
      Applies the given effects to the suspicious stew item.
      Specified by:
      suspiciousStewEffects in interface AbstractItemStack<org.bukkit.inventory.ItemStack>
      Parameters:
      effects - a list of EffectInstance objects representing the effects to be applied to the suspicious stew
      Returns:
      an AbstractItemStack representing the suspicious stew with the applied effects
      Since:
      0.2.0.0
      See Also:
    • suspiciousStewEffects

      public AbstractItemStack<org.bukkit.inventory.ItemStack> suspiciousStewEffects(EffectInstance... effects)
      Applies the given effects to a suspicious stew item.
      Specified by:
      suspiciousStewEffects in interface AbstractItemStack<org.bukkit.inventory.ItemStack>
      Parameters:
      effects - an array of EffectInstance objects representing the effects to apply to the suspicious stew
      Returns:
      an AbstractItemStack representing the suspicious stew item with the applied effects
      Since:
      0.2.0.0
      See Also:
    • tool

      public PaperItemStack tool(float defaultSpeed, int blockDamage, boolean canDestroyBlocksCreative, List<ToolRule> rules)
      Constructs a new tool item with the specified characteristics.
      Specified by:
      tool in interface AbstractItemStack<org.bukkit.inventory.ItemStack>
      Parameters:
      defaultSpeed - the default speed of the tool
      blockDamage - the damage inflicted by the tool to blocks
      canDestroyBlocksCreative - if the tool can destroy blocks in creative mode
      rules - a list of rules that define the behavior of the tool
      Returns:
      an PaperItemStack instance representing the created tool
      Since:
      0.2.0.0
      See Also:
    • tooltipDisplay

      public AbstractItemStack<org.bukkit.inventory.ItemStack> tooltipDisplay(boolean hideTooltip, String... hiddenComponents)
      Displays tooltip for the item stack with an option to hide certain components.
      Specified by:
      tooltipDisplay in interface AbstractItemStack<org.bukkit.inventory.ItemStack>
      Parameters:
      hideTooltip - Flag to hide the tooltip
      hiddenComponents - Array of components to hide in the tooltip
      Returns:
      An AbstractItemStack object with the tooltip displayed
      Since:
      0.2.0.0
      See Also:
    • tooltipStyle

      Updates the tooltip style of the item stack.
      Specified by:
      tooltipStyle in interface AbstractItemStack<org.bukkit.inventory.ItemStack>
      Parameters:
      style - the style to apply to the tooltip
      Returns:
      the updated PaperItemStack instance
      Since:
      0.2.0.0
      See Also:
    • trim

      public PaperItemStack trim(String pattern, String material, boolean showInTooltip)
      Updates the trim properties of the item stack.
      Specified by:
      trim in interface AbstractItemStack<org.bukkit.inventory.ItemStack>
      Parameters:
      pattern - the trim pattern
      material - the trim material
      showInTooltip - whether to display the trim in the tooltip
      Returns:
      the updated PaperItemStack instance
      Since:
      0.2.0.0
      See Also:
    • unbreakable

      public PaperItemStack unbreakable(boolean showInTooltip)
      Updates the unbreakable property of the item stack.
      Specified by:
      unbreakable in interface AbstractItemStack<org.bukkit.inventory.ItemStack>
      Parameters:
      showInTooltip - whether to display the unbreakable property in the tooltip
      Returns:
      the updated PaperItemStack instance
      Since:
      0.2.0.0
      See Also:
    • useCooldown

      public PaperItemStack useCooldown(String cooldownGroup, float seconds)
      Updates the use cooldown properties of the item stack.
      Specified by:
      useCooldown in interface AbstractItemStack<org.bukkit.inventory.ItemStack>
      Parameters:
      cooldownGroup - the cooldown group identifier
      seconds - the cooldown duration in seconds
      Returns:
      the updated PaperItemStack instance
      Since:
      0.2.0.0
      See Also:
    • weapon

      public PaperItemStack weapon(int damagePerAttack, boolean canDisableBlocking)
      Represents a weapon item that can be used for combat. Since MC Snapshot 25w02a.
      Specified by:
      weapon in interface AbstractItemStack<org.bukkit.inventory.ItemStack>
      Parameters:
      damagePerAttack - The amount of damage this weapon inflicts per attack
      canDisableBlocking - Whether this weapon can disable blocking when used
      Since:
      0.2.0.0
      See Also:
    • writableBookContent

      Updates the writable book content of the item stack.
      Specified by:
      writableBookContent in interface AbstractItemStack<org.bukkit.inventory.ItemStack>
      Parameters:
      pages - the pages to include in the writable book
      Returns:
      the updated PaperItemStack instance
      Since:
      0.2.0.0
      See Also:
    • writtenBookContent

      public PaperItemStack writtenBookContent(String title, String author, int generation, boolean resolved, List<String> pages)
      Updates the written book content of the item stack.
      Specified by:
      writtenBookContent in interface AbstractItemStack<org.bukkit.inventory.ItemStack>
      Parameters:
      title - the title of the book
      author - the author of the book
      generation - the generation of the book
      resolved - whether the book is resolved
      pages - the pages to include in the book
      Returns:
      the updated PaperItemStack instance
      Since:
      0.2.0.0
      See Also: