A spigot library to support all particles from 1.8 to 1.14
JavaDoc: http://xenondevs.xyz/particledoc/
It's really simple. You just have to choose the particle you want to display and then use the display method.
Example:
ParticleEffect.FLAME.display(player.getLocation(), Bukkit.getOnlinePlayers());
Parameter explanation:
- The location at which the particle should be displayed.
- The players that will see the particle.
You can also give extra data to the particle.
If a particle has the PropertyType "Directional" it can have a custom velocity. This velocity is specified in the offsetX, offsetY and offsetZ parameters. However, you can also specify a Vector in the display method.
Special: The particles Enchantment_Table and Nautilus will be displayed at the offset location and fly to the original location.
Example:
ParticleEffect.CAMPFIRE_SIGNAL_SMOKE.display(player.getLocation(), new Vector(1, 0, 1), 1f, 0, null, Bukkit.getOnlinePlayers());
Parameter explanation:
- The location at which the particle should be displayed.
- The velocity at which the particle will fly off.
- The speed of the particle.
- The amount of particles. This parameter is has to be 0 or it won't have the defined velocity.
- Since our particle doesn't need any extra data, the ParticleData is set to
null
- The players that will see the particle.
If a particle has the PropertyType "Colorable" it can have a user defined color. This color can be set with a implementation of the ParticleColor class. The RGB values of the color are set as the offsetX, offsetY and offsetZ values of the particle.
Special:
- Since 1.13 redstone has a own object for its RGB values. Therefore offsetX, offsetY and offsetZ can be used.
- Note colors don't have a RGB value. They only support a note value from 0 to 24. Use "NoteColor" for this particle.
Example:
ParticleEffect.SPELL_MOB.display(player.getLocation(), new RegularColor(ParticleEffect.SPELL_MOB, new Color(52, 152, 219)));
Parameter explanation:
- The location at which the particle should be displayed.
- A new RegularColor object to specify the color the particle will have.
- The players that will see the particle.
If a particle has the PropertyType "Requires Block" or "Requires Item" a texture of either a block or item can be defined. This texture is set with a implementation of the ParticleTexture class.
Block Example:
ParticleEffect.FALLING_DUST.display(player.getLocation(), 5, 0, 5, 1f, 5, new BlockTexture(ParticleEffect.FALLING_DUST, Material.REDSTONE_BLOCK), Bukkit.getOnlinePlayers());
Parameter explanation:
- The location at which the particle should be displayed.
- The x offset of the particle.
- The y offset of the particle.
- The Z offset of the particle.
- The speed at which the particle flies of.
- The amount of particles that will be displayed
- The texture the particle will should have. (In this case it's a redstone block.)
- The players that will see the particle.
Item Example:
ParticleEffect.ITEM_CRACK.display(player.getLocation(), 5, 0, 5, 1f, 5, new ItemTexture(ParticleEffect.ITEM_CRACK, new ItemStack(Material.DIAMOND_SWORD)), Bukkit.getOnlinePlayers());
Parameter explanation:
- The location at which the particle should be displayed.
- The x offset of the particle.
- The y offset of the particle.
- The Z offset of the particle.
- The speed at which the particle flies of.
- The amount of particles that will be displayed
- The texture the particle will should have. (In this case it's a Diamond sword.)
- The players that will see the particle.