Class GameEffect
java.lang.Object
org.skriptlang.skript.bukkit.particles.GameEffect
A class to hold metadata about
Effects before playing.-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionGameEffect(org.bukkit.Effect effect) Creates a new GameEffect with the given effect. -
Method Summary
Modifier and TypeMethodDescriptionvoidPlays the effect at the given location.voiddrawForPlayer(org.bukkit.Location location, @NotNull org.bukkit.entity.Player player) Plays the effect for the given player.static String[]@Nullable ObjectgetData()The optional data for this effect.org.bukkit.EffectThe backingEffect.static GameEffectParses a GameEffect from the given input string.booleanSets the data for this effect.toString()toString(int flags)
-
Field Details
-
ENUM_UTILS
-
-
Constructor Details
-
GameEffect
public GameEffect(org.bukkit.Effect effect) Creates a new GameEffect with the given effect.- Parameters:
effect- the effect
-
-
Method Details
-
parse
Parses a GameEffect from the given input string. Prints errors if the parsed effect requires data.- Parameters:
input- the input string- Returns:
- the parsed GameEffect, or null if the input is invalid
-
getEffect
public org.bukkit.Effect getEffect()The backingEffect.- Returns:
- the effect
-
getData
The optional data for this effect.- Returns:
- the data, or null if none is set (or not required)
-
setData
Sets the data for this effect. The data must be of the correct type for the effect.- Parameters:
data- the data to set. May only be null for the ELECTRIC_SPARK effect.- Returns:
- true if the data was set correctly, false otherwise
-
draw
Plays the effect at the given location. The given location must have a world.- Parameters:
location- the location to play the effect atradius- the radius to play the effect in, or null to use the default radius
-
drawForPlayer
public void drawForPlayer(org.bukkit.Location location, @NotNull @NotNull org.bukkit.entity.Player player) Plays the effect for the given player.- Parameters:
location- the location to play the effect atplayer- the player to play the effect for
-
toString
-
toString
-
getAllNamesWithoutData
- Returns:
- an array of all effect names that do not require data.
-