So I have double and triple checked my YML and ran it through a validator. My plugins load up fine, I can create a hello world command within my Main class that works. However upon using a second .java file with a second command it continuously displays my YML usage text.
Main.java
package lordfluffyjr.TarrenCraft.jEssentialsX.commandSrc;
import java.util.logging.Logger;
import org.bukkit.Bukkit;
import org.bukkit.event.Listener;
import org.bukkit.plugin.PluginManager;
import org.bukkit.plugin.java.JavaPlugin;
public class Main extends JavaPlugin implements Listener { //Extending JavaPlugin so that Bukkit
knows its the main class
//Housekeeping
Logger jEssentialsXLogger = Bukkit.getLogger();
@Override
public void onEnable(){// Where plugins will be loaded.
PluginManager manager = getServer().getPluginManager();
manager.registerEvents(this, this);
Bukkit.getServer().getConsoleSender().sendMessage("jEssentialsX has been enabled!");
//Enable FAQ
manager.registerEvents(new Faq(), this);
Bukkit.getServer().getConsoleSender().sendMessage("FAQ has been enabled!");
}
@Override
public void onDisable(){// Where plugins will be disabled.
jEssentialsXLogger.info("Test 1 has been disabled!");
jEssentialsXLogger.severe("Test 1 has an error and has not loaded.");
}
}
Faq.java
package lordfluffyjr.TarrenCraft.jEssentialsX.commandSrc;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
import org.bukkit.event.Listener;
public class Faq implements Listener, CommandExecutor{
public boolean onCommand(CommandSender sender, Command cmd, String commandLabel, String[] args)
{
if (commandLabel.equalsIgnoreCase("faq")) {
sender.sendMessage("Welcome to our FAQ!");
return true;
}
return false;
}
}
plugin.yml
main: lordfluffyjr.TarrenCraft.jEssentialsX.commandSrc.Main
name: jEssentialsX
version: 0.1
author: LordFluffyJr
api-version: 1.16
commands:
faq:
description: A list of our frequently asked questions plugin description!
usage: Syntax error! Use [/faq <topic> <page number>]
question from:
https://stackoverflow.com/questions/65647339/invalid-bukkit-command-yml-error-catch-with-valid-yml 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…