public interface FireworkMeta extends ItemMeta
Material.FIREWORK
and its effects.限定符和类型 | 方法和说明 |
---|---|
void |
addEffect(FireworkEffect effect)
Add another effect to this firework.
|
void |
addEffects(FireworkEffect... effects)
Add several effects to this firework.
|
void |
addEffects(java.lang.Iterable<FireworkEffect> effects)
Add several firework effects to this firework.
|
void |
clearEffects()
Remove all effects from this firework.
|
FireworkMeta |
clone() |
java.util.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.
|
addEnchant, addItemFlags, getDisplayName, getEnchantLevel, getEnchants, getItemFlags, getLocalizedName, getLore, hasConflictingEnchant, hasDisplayName, hasEnchant, hasEnchants, hasItemFlag, hasLocalizedName, hasLore, isUnbreakable, removeEnchant, removeItemFlags, setDisplayName, setLocalizedName, setLore, setUnbreakable
serialize
void addEffect(FireworkEffect effect) throws java.lang.IllegalArgumentException
effect
- The firework effect to addjava.lang.IllegalArgumentException
- If effect is nullvoid addEffects(FireworkEffect... effects) throws java.lang.IllegalArgumentException
effects
- The firework effects to addjava.lang.IllegalArgumentException
- If effects is nulljava.lang.IllegalArgumentException
- If any effect is null (may be thrown
after changes have occurred)void addEffects(java.lang.Iterable<FireworkEffect> effects) throws java.lang.IllegalArgumentException
effects
- An iterable object whose iterator yields the desired
firework effectsjava.lang.IllegalArgumentException
- If effects is nulljava.lang.IllegalArgumentException
- If any effect is null (may be thrown
after changes have occurred)java.util.List<FireworkEffect> getEffects()
int getEffectsSize()
void removeEffect(int index) throws java.lang.IndexOutOfBoundsException
index
- The index of the effect to removejava.lang.IndexOutOfBoundsException
- If index < 0 or index > getEffectsSize()
void clearEffects()
boolean hasEffects()
int getPower()
void setPower(int power) throws java.lang.IllegalArgumentException
power
- the power of the firework, from 0-128java.lang.IllegalArgumentException
- if height<0 or height>128FireworkMeta clone()