Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package com.bukiitParticleEffectsLobby;
- import org.bukkit.Bukkit;
- import org.bukkit.Location;
- import org.bukkit.entity.Player;
- import org.bukkit.event.EventHandler;
- import org.bukkit.event.Listener;
- import org.bukkit.event.player.PlayerInteractEvent;
- import org.bukkit.plugin.java.JavaPlugin;
- public class Main extends JavaPlugin implements Listener {
- @Override
- public void onEnable() {
- Bukkit.getServer().getPluginManager().registerEvents(this, this);
- }
- @EventHandler
- public void onPlayerInteract(PlayerInteractEvent e) {
- if (e.getClickedBlock() == null) {
- return;
- } else {
- Player p = e.getPlayer();
- int radius = 2;
- int radiusB = -2;
- for(double y = 0; y <= 5; y+=0.005) {
- Location playerLoc = p.getLocation();
- double x = radius * Math.cos(y);
- double z = radius * Math.sin(y);
- playerLoc.add(x, y, z);
- ParticleEffect.FIREWORKS_SPARK.display(0, 0, 0, 0, 1, playerLoc, 40);
- playerLoc.subtract(x, y, z);
- Location playerLoc2 = p.getLocation();
- double x2 = radiusB * Math.cos(y);
- double z2 = radius * Math.sin(y);
- playerLoc2.add(x2, y, z2);
- ParticleEffect.FLAME.display(0, 0, 0, 0, 1, playerLoc2, 40);
- playerLoc2.subtract(x2, y, z2);
- try {
- Thread.sleep(3);
- } catch (InterruptedException e1) {
- e1.printStackTrace();
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment