Visual Effects
Stunning effects designed with ease.
Visual effects can be created very simply as described below.
Basic Visual Effect
VisualEffect effect = new PhantomEffect()
{
@Override
public void play(Location location)
{
//Play your new effect here... You can do anything you like
ParticleEffect.CLOUD.display(1f, 1f, 1f, 0.5f, 1, location, 12);
}
};
//Now you can use this anytime
effect.play(Bukkit.getPlayer("cyberpwn").getLocation());
Particle Manipulators
Allows extra processing to use your effect. Lets make a line with our effect above
Lets make it
//Our old effect
VisualEffect effect = new PhantomEffect()
{
@Override
public void play(Location location)
{
//Play your new effect here... You can do anything you like
ParticleEffect.CLOUD.display(1f, 1f, 1f, 0.5f, 1, location, 12);
}
};
//Lets play our old effect across a line!
VisualEffect line = new LineParticleManipulator()
{
@Override
public void play(Location location)
{
//Do anything in here.
effect.play(location);
}
};
//Draw the line!
((LineParticleManipulator)line).play(Location a, Location b, 1.0);
Remember lines are visual effects, so they can be played in other effects!