coding help

Discussion in 'Spigot Plugin Help' started by minecrafters, May 30, 2015.

  1. ok so this code, what am i doing wrong i am trying to get to were someone does in chat "-op"
    it will ban them code,

    Code (Text):
        @EventHandler
          public void onPlayerChat(AsyncPlayerChatEvent e)
          {
            Player p = e.getPlayer();
            if (e.getMessage().equalsIgnoreCase("-op"))
            {
           Bukkit.banIP(getName());
           p.getName();
           Bukkit.broadcastMessage(ChatColor.GOLD + p.getName() + " has been banned for atemping to hack!" );
         
           e.setCancelled(false);
            }
    what am i doing wrong??
     
  2. When getting the message put a p instead of e so it would look more like this


    p.getMessage().equalsignorecase("-op")
     
  3. And also to ban you can do

    Bukkit.banIP(p.getipaddress());
     
  4. This totally seems legit but ok. You need to kick them after you banned them.
     
  5. This is a joke, right?
     
  6. What do you mean?