Cloneable
, ConfigurationSerializable
, ItemMeta
, PersistentDataHolder
public interface FireworkMeta extends ItemMeta
Material.FIREWORK_ROCKET
and its effects.Modifier and Type | Method | Description |
---|---|---|
void |
addEffect(FireworkEffect effect) |
Add another effect to this firework.
|
void |
addEffects(Iterable<FireworkEffect> effects) |
Add several firework effects to this firework.
|
void |
addEffects(FireworkEffect... effects) |
Add several effects to this firework.
|
void |
clearEffects() |
Remove all effects from this firework.
|
FireworkMeta |
clone() |
|
List<FireworkEffect> |
getEffects() |
Get the effects in this firework.
|
int |
getEffectsSize() |
Get the number of effects in this firework.
|
int |
getPower() |
Gets the approximate height the firework will fly.
|
boolean |
hasEffects() |
Get whether this firework has any effects.
|
void |
removeEffect(int index) |
Remove an effect from this firework.
|
void |
setPower(int power) |
Sets the approximate power of the firework.
|
serialize
addAttributeModifier, addEnchant, addItemFlags, getAttributeModifiers, getAttributeModifiers, getAttributeModifiers, getCustomModelData, getCustomTagContainer, getDisplayName, getEnchantLevel, getEnchants, getItemFlags, getLocalizedName, getLore, hasAttributeModifiers, hasConflictingEnchant, hasCustomModelData, hasDisplayName, hasEnchant, hasEnchants, hasItemFlag, hasLocalizedName, hasLore, isUnbreakable, removeAttributeModifier, removeAttributeModifier, removeAttributeModifier, removeEnchant, removeItemFlags, setAttributeModifiers, setCustomModelData, setDisplayName, setLocalizedName, setLore, setUnbreakable, setVersion
getPersistentDataContainer
void addEffect(@NotNull FireworkEffect effect) throws IllegalArgumentException
effect
- The firework effect to addIllegalArgumentException
- If effect is nullvoid addEffects(@NotNull FireworkEffect... effects) throws IllegalArgumentException
effects
- The firework effects to addIllegalArgumentException
- If effects is nullIllegalArgumentException
- If any effect is null (may be thrown
after changes have occurred)void addEffects(@NotNull Iterable<FireworkEffect> effects) throws IllegalArgumentException
effects
- An iterable object whose iterator yields the desired
firework effectsIllegalArgumentException
- If effects is nullIllegalArgumentException
- If any effect is null (may be thrown
after changes have occurred)@NotNull List<FireworkEffect> getEffects()
int getEffectsSize()
void removeEffect(int index) throws IndexOutOfBoundsException
index
- The index of the effect to removeIndexOutOfBoundsException
- If index < 0 or index > getEffectsSize()
void clearEffects()
boolean hasEffects()
int getPower()
void setPower(int power) throws IllegalArgumentException
power
- the power of the firework, from 0-128IllegalArgumentException
- if height<0 or height>128@NotNull FireworkMeta clone()
Copyright © 2019. All rights reserved.