-
Bug
-
Resolution: Invalid
-
Minor
-
None
-
None
-
```java
package pluginsUghhhh.vzplugin;
import org.bukkit.plugin.java.JavaPlugin;
import pluginsUghhhh.vzplugin.heal;public final class VZplugin extends JavaPlugin {
@Override
{ this.getCommand("heal").setExecutor(new heal()); }
public void onEnable()@Override
{ // Plugin shutdown logic }
public void onDisable()}
```
main class
```javapackage pluginsUghhhh.vzplugin;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
import org.bukkit.command.ConsoleCommandSender;
import org.bukkit.entity.Player;public class heal implements CommandExecutor {
@Override
{ player.setHealth(player.getMaxHealth()); sender.sendMessage("u are healed(ggez)"); return true; }
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
if (sender instanceof Player) {
Player player = (Player) sender;
if (command.getName().equalsIgnoreCase("heal"))} else
{ sender.sendMessage("BRUH"); }return false;
}
}```
command class
```yml
name: VZplugin
main: pluginsUghhhh.vzplugin.VZplugin
version: 1.0
commands:
heal:
description: heal urself
usage: /heal
api-version: 1.16.1```
yml plugin
```java package pluginsUghhhh.vzplugin; import org.bukkit.plugin.java.JavaPlugin; import pluginsUghhhh.vzplugin.heal; public final class VZplugin extends JavaPlugin { @Override public void onEnable() { this.getCommand("heal").setExecutor(new heal()); } @Override public void onDisable() { // Plugin shutdown logic } } ``` main class ```java package pluginsUghhhh.vzplugin; import org.bukkit.command.Command; import org.bukkit.command.CommandExecutor; import org.bukkit.command.CommandSender; import org.bukkit.command.ConsoleCommandSender; import org.bukkit.entity.Player; public class heal implements CommandExecutor { @Override public boolean onCommand(CommandSender sender, Command command, String label, String[] args) { if (sender instanceof Player) { Player player = (Player) sender; if (command.getName().equalsIgnoreCase("heal")) { player.setHealth(player.getMaxHealth()); sender.sendMessage("u are healed(ggez)"); return true; } } else { sender.sendMessage("BRUH"); } return false; } } ``` command class ```yml name: VZplugin main: pluginsUghhhh.vzplugin.VZplugin version: 1.0 commands: heal: description: heal urself usage: /heal api-version: 1.16.1 ``` yml plugin
-
1.16.1
-
Yes
(all my indentations are right it just didnt paste correctly), im getting an npe at onenable when setting executor