public abstract class Effect extends Object implements Runnable
| Modifier and Type | Field and Description |
|---|---|
int |
arrivalTime
Used only by the vibration particle in 1.17 and up
|
boolean |
asynchronous
If set, will run asynchronously.
|
boolean |
autoOrient
If true, and a "target" Location or Entity is set, the two Locations
will orient to face one another.
|
Runnable |
callback
Callback to run, after effect is done.
|
org.bukkit.Color |
color
Can be used to colorize certain particles.
|
List<org.bukkit.Color> |
colorList |
String |
colors |
int |
delay
Delay to wait for delayed effects.
|
boolean |
disappearWithOriginEntity
Should this effect stop playing if the origin entity becomes invalid?
|
boolean |
disappearWithTargetEntity
Should this effect stop playing if the target entity becomes invalid?
|
Integer |
duration
Total duration of this effect in milliseconds.
|
protected EffectManager |
effectManager |
int |
iterations
Amount of repetitions to do.
|
org.bukkit.Material |
material
The Material and data to use for block and item break particles
|
byte |
materialData |
protected int |
maxIterations
This will store the base number of iterations
|
org.bukkit.util.Vector |
offset
If set, will offset the origin location
|
protected DynamicLocation |
origin |
int |
particleCount
These can be used to spawn multiple particles per packet.
|
float |
particleData
This can be used to give particles a set speed when spawned.
|
float |
particleOffsetX
These can be used to apply an offset to spawned particles, particularly
useful when spawning multiples.
|
float |
particleOffsetY |
float |
particleOffsetZ |
float |
particleSize
This can be used to scale up or down a particle's size.
|
int |
period
Interval to wait for repeating effects.
|
Float |
pitch |
float |
pitchOffset |
double |
probability
Probability that this effect will play on each iteration
|
org.bukkit.util.Vector |
relativeOffset
If set, will offset the origin location, relative to the origin direction
|
float |
speed
Deprecated.
|
org.bukkit.configuration.ConfigurationSection |
subEffect |
protected DynamicLocation |
target |
org.bukkit.util.Vector |
targetOffset
If set, will offset the target location
|
org.bukkit.entity.Player |
targetPlayer
A specific player who should see this effect.
|
List<org.bukkit.entity.Player> |
targetPlayers
A group of players who should see this effect.
|
org.bukkit.Color |
toColor
Used for dust particles in 1.17 and up, to make a color transition.
|
List<org.bukkit.Color> |
toColorList |
String |
toColors |
EffectType |
type
Handles the type, the effect is played.
|
boolean |
updateDirections
If set to false, Entity-bound directions will not update during the Effect
|
boolean |
updateLocations
If set to false, Entity-bound locations will not update during the Effect
|
float |
visibleRange
Display particles to players within this radius.
|
Float |
yaw |
float |
yawOffset
These are used to modify the direction of the origin Location.
|
| Constructor and Description |
|---|
Effect(EffectManager effectManager) |
| Modifier and Type | Method and Description |
|---|---|
void |
cancel() |
void |
cancel(boolean callback) |
protected void |
display(org.bukkit.Particle effect,
org.bukkit.Location location) |
protected void |
display(org.bukkit.Particle particle,
org.bukkit.Location location,
org.bukkit.Color color) |
protected void |
display(org.bukkit.Particle particle,
org.bukkit.Location location,
org.bukkit.Color color,
org.bukkit.Color toColor,
float speed,
int amount) |
protected void |
display(org.bukkit.Particle particle,
org.bukkit.Location location,
org.bukkit.Color color,
float speed,
int amount) |
protected void |
display(org.bukkit.Particle particle,
org.bukkit.Location location,
float speed,
int amount) |
int |
getDelay() |
org.bukkit.entity.Entity |
getEntity()
Extending Effect classes can use this to determine the Entity this
Effect is centered upon.
|
org.bukkit.Location |
getLocation()
Extending Effect classes should use this method to obtain the
current "root" Location of the effect.
|
int |
getPeriod() |
long |
getStartTime() |
org.bukkit.Location |
getTarget()
Extending Effect classes should use this method to obtain the
current "target" Location of the effect.
|
org.bukkit.entity.Entity |
getTargetEntity()
Extending Effect classes can use this to determine the Entity this
Effect is targeted upon.
|
org.bukkit.entity.Player |
getTargetPlayer() |
EffectType |
getType() |
void |
infinite() |
protected void |
initialize() |
boolean |
isAsynchronous() |
boolean |
isDone() |
void |
onDone()
Called when this effect is done playing (when
done() is called). |
abstract void |
onRun() |
protected List<org.bukkit.Color> |
parseColorList(String colors) |
void |
prepare() |
void |
reloadParameters() |
protected void |
reset()
Effects should override this if they want to be reusable, this is called prior to starting so
state can be reset.
|
void |
run() |
void |
setDynamicOrigin(DynamicLocation location)
Set the Location this Effect is centered on.
|
void |
setDynamicTarget(DynamicLocation location)
Set the Location this Effect is targeting.
|
void |
setEntity(org.bukkit.entity.Entity entity) |
void |
setLocation(org.bukkit.Location location) |
void |
setStartTime(long startTime) |
void |
setTargetEntity(org.bukkit.entity.Entity entity) |
void |
setTargetLocation(org.bukkit.Location location) |
void |
setTargetPlayer(org.bukkit.entity.Player p) |
void |
start() |
protected void |
updateDuration() |
protected void |
updateLocation() |
protected void |
updateTarget() |
protected boolean |
validate() |
public org.bukkit.configuration.ConfigurationSection subEffect
public EffectType type
de.slikey.effectlib.EffectType}public org.bukkit.Color color
public List<org.bukkit.Color> colorList
public String colors
public org.bukkit.Color toColor
public List<org.bukkit.Color> toColorList
public String toColors
public int arrivalTime
@Deprecated public float speed
public float particleData
public int delay
de.slikey.effectlib.EffectType}public int period
de.slikey.effectlib.EffectType}public int iterations
de.slikey.effectlib.EffectType}public Integer duration
public double probability
public Runnable callback
java.lang.Runnable}public float visibleRange
public boolean autoOrient
public org.bukkit.util.Vector offset
public org.bukkit.util.Vector relativeOffset
public org.bukkit.util.Vector targetOffset
public float yawOffset
public float pitchOffset
public Float yaw
public Float pitch
public boolean updateLocations
public boolean updateDirections
public org.bukkit.entity.Player targetPlayer
public List<org.bukkit.entity.Player> targetPlayers
public org.bukkit.Material material
public byte materialData
public int particleCount
public float particleOffsetX
public float particleOffsetY
public float particleOffsetZ
public float particleSize
public boolean asynchronous
protected final EffectManager effectManager
protected DynamicLocation origin
protected DynamicLocation target
protected int maxIterations
public boolean disappearWithOriginEntity
public boolean disappearWithTargetEntity
public Effect(EffectManager effectManager)
protected void initialize()
public final void cancel()
public final void cancel(boolean callback)
public final boolean isDone()
public abstract void onRun()
public void onDone()
done() is called).protected void reset()
public void prepare()
public final void start()
public final void infinite()
public org.bukkit.entity.Entity getEntity()
public org.bukkit.entity.Entity getTargetEntity()
public final org.bukkit.Location getLocation()
public final org.bukkit.Location getTarget()
public void setDynamicOrigin(DynamicLocation location)
public void setDynamicTarget(DynamicLocation location)
protected final boolean validate()
protected void updateDuration()
protected void updateLocation()
protected void updateTarget()
protected void display(org.bukkit.Particle effect,
org.bukkit.Location location)
protected void display(org.bukkit.Particle particle,
org.bukkit.Location location,
org.bukkit.Color color)
protected void display(org.bukkit.Particle particle,
org.bukkit.Location location,
float speed,
int amount)
protected void display(org.bukkit.Particle particle,
org.bukkit.Location location,
org.bukkit.Color color,
float speed,
int amount)
protected void display(org.bukkit.Particle particle,
org.bukkit.Location location,
org.bukkit.Color color,
org.bukkit.Color toColor,
float speed,
int amount)
public EffectType getType()
public boolean isAsynchronous()
public int getDelay()
public int getPeriod()
public void setEntity(org.bukkit.entity.Entity entity)
public void setLocation(org.bukkit.Location location)
public void setTargetEntity(org.bukkit.entity.Entity entity)
public void setTargetLocation(org.bukkit.Location location)
public org.bukkit.entity.Player getTargetPlayer()
public void setTargetPlayer(org.bukkit.entity.Player p)
public long getStartTime()
public void setStartTime(long startTime)
public void reloadParameters()
Copyright © 2021 elMakers. All rights reserved.