Class SuspiciousStewBuilder

java.lang.Object
io.github.lucfr1746.llibrary.itemstack.ItemBuilder
io.github.lucfr1746.llibrary.itemstack.SuspiciousStewBuilder

public class SuspiciousStewBuilder extends ItemBuilder
The SuspiciousStewBuilder class extends ItemBuilder to provide additional functionality for modifying SuspiciousStewMeta of an ItemStack. This includes adding, removing, and retrieving custom potion effects.
  • Constructor Details

    • SuspiciousStewBuilder

      public SuspiciousStewBuilder(@NotNull @NotNull org.bukkit.inventory.ItemStack itemStack)
      Constructs a SuspiciousStewBuilder using an existing ItemStack.
      Parameters:
      itemStack - The item stack to modify.
      Throws:
      IllegalArgumentException - If the item is not a Suspicious Stew.
    • SuspiciousStewBuilder

      public SuspiciousStewBuilder(int amount)
      Constructs a SuspiciousStewBuilder with a new Suspicious Stew item.
      Parameters:
      amount - The quantity of stews in the stack.
  • Method Details

    • addEffect

      public SuspiciousStewBuilder addEffect(@NotNull @NotNull org.bukkit.potion.PotionEffect effect, boolean overwrite)
      Adds a custom potion effect to the suspicious stew.
      Parameters:
      effect - The potion effect to add.
      overwrite - Whether to overwrite an existing effect of the same type.
      Returns:
      This SuspiciousStewBuilder instance for chaining.
    • removeEffect

      public SuspiciousStewBuilder removeEffect(@NotNull @NotNull org.bukkit.potion.PotionEffectType type)
      Removes a custom potion effect from the suspicious stew.
      Parameters:
      type - The type of potion effect to remove.
      Returns:
      This SuspiciousStewBuilder instance for chaining.
    • clearEffects

      public SuspiciousStewBuilder clearEffects()
      Removes all custom potion effects from the suspicious stew.
      Returns:
      This SuspiciousStewBuilder instance for chaining.
    • hasEffects

      public boolean hasEffects()
      Checks if the stew has any custom potion effects.
      Returns:
      True if there are custom effects, false otherwise.
    • hasEffect

      public boolean hasEffect(@NotNull @NotNull org.bukkit.potion.PotionEffectType type)
      Checks if the stew has a specific potion effect.
      Parameters:
      type - The type of potion effect to check for.
      Returns:
      True if the effect is present, false otherwise.
    • getEffects

      @NotNull public @NotNull List<org.bukkit.potion.PotionEffect> getEffects()
      Gets an immutable list of all custom potion effects on the suspicious stew.
      Returns:
      A list of PotionEffect instances.