Class SuspiciousStewBuilder
java.lang.Object
io.github.lucfr1746.llibrary.itemstack.ItemBuilder
io.github.lucfr1746.llibrary.itemstack.SuspiciousStewBuilder
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 Summary
ConstructorsConstructorDescriptionSuspiciousStewBuilder
(int amount) Constructs aSuspiciousStewBuilder
with a new Suspicious Stew item.SuspiciousStewBuilder
(@NotNull org.bukkit.inventory.ItemStack itemStack) Constructs aSuspiciousStewBuilder
using an existingItemStack
. -
Method Summary
Modifier and TypeMethodDescriptionaddEffect
(@NotNull org.bukkit.potion.PotionEffect effect, boolean overwrite) Adds a custom potion effect to the suspicious stew.Removes all custom potion effects from the suspicious stew.@NotNull List
<org.bukkit.potion.PotionEffect> Gets an immutable list of all custom potion effects on the suspicious stew.boolean
hasEffect
(@NotNull org.bukkit.potion.PotionEffectType type) Checks if the stew has a specific potion effect.boolean
Checks if the stew has any custom potion effects.removeEffect
(@NotNull org.bukkit.potion.PotionEffectType type) Removes a custom potion effect from the suspicious stew.Methods inherited from class io.github.lucfr1746.llibrary.itemstack.ItemBuilder
addAttributeModifier, addEnchant, addEnchant, addEnchant, addItemFlags, addLore, build, getAmount, getAttributeModifiers, getAttributeModifiers, getAttributeModifiers, getCustomModelData, getDamageResistant, getDisplayName, getEnchantable, getEnchantLevel, getEnchantmentGlintOverride, getEnchants, getEquippableComponent, getFoodComponent, getItemFlags, getItemMeta, getItemModel, getJukeboxPlayableComponent, getMaxStackSize, getRarity, getToolComponent, getTooltipStyle, getTranslationKey, getType, getUseCooldownComponent, getUseRemainder, hasAttributeModifiers, hasConflictingEnchant, hasCustomModelData, hasDamageResistant, hasEnchant, hasEnchantable, hasEnchantmentGlintOverride, hasEnchants, hasEquippableComponent, hasFoodComponent, hasItemFlag, hasItemModel, hasJukeboxPlayableComponent, hasMaxStackSize, hasRarity, hasToolComponent, hasTooltipStyle, hasUseCooldownComponent, hasUseRemainder, hideAllItemFlags, insertLore, isGlider, isHideTooltip, isUnbreakable, removeAttributeModifier, removeAttributeModifier, removeAttributeModifier, removeEnchant, removeEnchants, removeItemFlags, replaceLore, setAmount, setAttributeModifiers, setCustomModelData, setDamageResistant, setDisplayName, setEnchantable, setEnchantmentGlintOverride, setEquippableComponent, setEquippableComponent, setFood, setFoodComponent, setGlider, setHideTooltip, setItemModel, setItemModel, setJukeboxPlayableComponent, setJukeboxPlayableComponent, setJukeboxPlayableComponent, setLores, setLores, setMaxStackSize, setRarity, setToolComponent, setToolComponent, setTooltipStyle, setTooltipStyle, setType, setUnbreakable, setUseCooldownComponent, setUseCooldownComponent, setUseCooldownComponent, setUseRemainder
-
Constructor Details
-
SuspiciousStewBuilder
public SuspiciousStewBuilder(@NotNull @NotNull org.bukkit.inventory.ItemStack itemStack) Constructs aSuspiciousStewBuilder
using an existingItemStack
.- Parameters:
itemStack
- The item stack to modify.- Throws:
IllegalArgumentException
- If the item is not a Suspicious Stew.
-
SuspiciousStewBuilder
public SuspiciousStewBuilder(int amount) Constructs aSuspiciousStewBuilder
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
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
Gets an immutable list of all custom potion effects on the suspicious stew.- Returns:
- A list of
PotionEffect
instances.
-