Closed
Description
CommandAPI version
9.1.0
Minecraft version
1.20.1
Are you shading the CommandAPI?
Yes
What I did
I encountered an issue when trying to use Bukkit#createCommandSender
in combination with Bukkit#dispatchCommand
.
val myCommandSender = Bukkit.createCommandSender { }
Bukkit.dispatchCommand(myCommandSender, "<anycommandapicommand>")
What actually happened
Executing commands from custom senders generated by Bukkit#createCommandSender
results in a NullPointerException
(see below) due to incorrect handling by the CommandAPI.
What should have happened
The CommandAPI should support the special CommandSender
returned by Bukkit#createCommandSender
.
Server logs and CommandAPI config
Cannot invoke "[...].dev.jorel.commandapi.commandsenders.AbstractCommandSender.getSource()"
because "this.val$sender" is null
Other
Given this method, the CommandAPI assumes that CommandSender
will only be the types provided by Spigot. However, on Paper, Bukkit#createCommandSender
returns io.papermc.paper.commands.FeedbackForwardingSender
, which extends CommandSender
.