java.lang.NullPointerException: Cannot invoke "org.bukkit.command.PluginCommand.setExecutor(org.bukkit.command.CommandExecutor)" because the return va

ALMikey

New member
Nov 26, 2023
3
0
1
java.lang.NullPointerException: Cannot invoke "org.bukkit.command.PluginCommand.setExecutor(org.bukkit.command.CommandExecutor)" because the return value of "org.bukkit.Server.getPluginCommand(String)" is null

How to solve it?
 

Machine Maker

Paper Developer
Staff member
Dec 17, 2021
132
6
19
18
California
You do not register commands in the paper-plugin.yml. You must handle command registration yourself by adding a class that extends command and adding it to the command map. Future API will be added to better handle command registration for plugins using the Paper Plugin system.

Feel free to continue to use plugin.yml. paper-plugin.yml is still experimental and being worked on, and support for plugin.yml isn't going away even when it isn't experimental.