Uploaded image for project: 'Spigot'
  1. Spigot
  2. SPIGOT-742

Vanilla Commands are not executable by custom CommandSenders

XMLWordPrintable

      The VanillaCommandWrapper#getListener(CommandSender) method will return null when the "sender" argument is a custom CommandSender. This will cause an NPE when calling Bukkit#dispatchCommand(CommandSender, String) with that CommandSender.

      E.g:

      public class CustomCommandSender implements CommandSender() {
      ...
      }

      CommandSender sender = new CustomCommandSender();

      Bukkit.dispatchCommand(sender, "save-all");
      // NPE at VanillaCommandWrapper#execute(CommandSender, String, String[]) (Line 42)

            Thinkofdeath Thinkofname
            Trojaner Trojaner
            Votes:
            1 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: