Class FireworkEffectBuilder
java.lang.Object
io.github.lucfr1746.llibrary.itemstack.ItemBuilder
io.github.lucfr1746.llibrary.itemstack.FireworkEffectBuilder
The
FireworkEffectBuilder
class extends ItemBuilder
to provide
additional functionality for modifying FireworkEffectMeta
of an ItemStack
.
This class allows setting firework effects, including colors, fade colors, flicker, and trail.-
Constructor Summary
ConstructorsConstructorDescriptionConstructs aFireworkEffectBuilder
with a newMaterial.FIREWORK_STAR
.FireworkEffectBuilder
(@NotNull org.bukkit.inventory.ItemStack itemStack) Constructs aFireworkEffectBuilder
using an existingItemStack
. -
Method Summary
Modifier and TypeMethodDescriptionorg.bukkit.FireworkEffect
Gets the firework effect.boolean
Checks if the firework effect exists.setEffect
(@NotNull org.bukkit.FireworkEffect effect) Sets the firework effect.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
-
FireworkEffectBuilder
public FireworkEffectBuilder()Constructs aFireworkEffectBuilder
with a newMaterial.FIREWORK_STAR
. -
FireworkEffectBuilder
public FireworkEffectBuilder(@NotNull @NotNull org.bukkit.inventory.ItemStack itemStack) Constructs aFireworkEffectBuilder
using an existingItemStack
.- Parameters:
itemStack
- the item stack to modify- Throws:
IllegalArgumentException
- if the item's meta is not an instance ofFireworkEffectMeta
-
-
Method Details
-
setEffect
Sets the firework effect.- Parameters:
effect
- the firework effect- Returns:
- this
FireworkEffectBuilder
instance for method chaining - Throws:
IllegalArgumentException
- if the effect is null
-
getEffect
public org.bukkit.FireworkEffect getEffect()Gets the firework effect.- Returns:
- the firework effect, or null if not set
-
hasEffect
public boolean hasEffect()Checks if the firework effect exists.- Returns:
- true if there is a firework effect, false otherwise
-