Uploaded image for project: 'SpigotPlugins'
  1. SpigotPlugins
  2. PLUG-84

event.setCancelled(true) not firing as it should be.

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Invalid
    • Icon: Minor Minor
    • Windows 7
      Java 7
      Spigot Server 1.8

    • Commander - Own Plugin

      When checking for a command such as /op from a StringList and then canceling the usage of this, the event.setcancled(true); does not stop this from happening and it carries on regardless.

      CODE:

      List<String> logcommands = plugin.Config.getStringList("Misc.commandlogger.commands");
      for (String s : logcommands) {
      if (plugin.Config.getBoolean("Misc.commandlogger.enabled", true)) {
      if (message.startsWith(s))

      { event.setCancelled(true); BufferedWriter out = new BufferedWriter(new FileWriter("admincommands.log", true)); event.setCancelled(true); out.write("[Command Logger]" + " " + " " + player.getName() + " " + " " + message + "\r\n"); out.close(); }

      }

      }

            Unassigned Unassigned
            KyleD1986 KyleD1986
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: