EnumParticle HELP?

Discussion in 'Spigot Plugin Development' started by ElbestHD, Apr 19, 2018.

  1. Hi, how can I solve this error that comes up and I do not know why, if you can help me, thank you
    Code (Text):
    import net.minecraft.server.v1_7_R4.PacketPlayOutWorldParticles;
    import java.util.ArrayList;
    import org.bukkit.Bukkit;
    import org.bukkit.Location;
    import org.bukkit.craftbukkit.v1_7_R4.entity.CraftPlayer;
    import org.bukkit.entity.Player;
    import org.bukkit.event.EventHandler;
    import org.bukkit.event.Listener;
    import org.bukkit.event.player.PlayerInteractEntityEvent;

    import com.TheEdwardVz.BuildFFA.staffMode.StaffCMD;

    public class Frozear implements Listener{

        public static ArrayList<Player> frozeados = new ArrayList<Player>();

        @EventHandler
        public void onFrozear(PlayerInteractEntityEvent e){

            Player p = e.getPlayer();
            Player t = (Player) e.getRightClicked();


            if(StaffCMD.staffs.contains(p)){
                if(p.getItemInHand().getItemMeta().getDisplayName().equals("§7<§6Frozear§7>")){
                    if(!StaffCMD.staffs.contains(t)){
                        if(!frozeados.contains(t)){
                            frozeados.add(t);
                            PacketPlayOutWorldParticles packet = new PacketPlayOutWorldParticles(
                                    EnumParticle.SNOWBALL,
                                    true,  
                                    t.getLocation().getBlockX(),
                                    t.getLocation().getBlockY(),
                                    t.getLocation().getBlockZ(),
                                    0,
                                    0,
                                    0,
                                    5,
                                    10_000,
                                    null
                            );

                            for(Player sv : Bukkit.getOnlinePlayers()){
                                ((CraftPlayer) sv).getHandle().playerConnection.sendPacket(packet);
                            }
                            InventariosFrozeado.MainFrozeado(t);
                        }else{
                            frozeados.remove(t);
                        }
                    }
                }
            }

        }


    }
     
     
  2. This is no error, this is a piece of code. Please provide us a stack trace.
     
  3. Benz56

    Moderator Supporter

    Well, it would help a lot if you would post the error you are getting.

    Damn. Friwi beat me to it :)
     
    • Agree Agree x 1
  4. upload_2018-4-19_13-36-9.png

    the error that comes out and I do not know why, sorry I forgot to put it
     
  5. Hit Strg+Shift+O and add the import. Hint: Next time you get a random error, click any text where the error is marked and hit F2, then choose one of the options to correct it (in this case an Import).