CommandAPI: You must be a ... to run this command

CommandAPI version 3.0

Minecraft version 1.15.2

Describe the bug When I (as a player with OP) try to run my command, it tells me “You must be a cruciuscommand to run this command”

My code This code reproduces the behavior:

public class CruciusCommand
{
	// -------------------------------------------- //
	// FIELDS
	// -------------------------------------------- //
	
	private Crucius plugin = Crucius.get();
	private LinkedHashMap<String, Argument> arguments = new LinkedHashMap<>();
	private String cmd = "crucius";
	private String[] aliases = { "cr", "cruc" };
	private CommandPermission permission = CommandPermission.fromString("crucius.basecommand");
	private String code = "en";
	
	// -------------------------------------------- //
	// INSTANCE & CONSTRUCT
	// -------------------------------------------- //
	
	private static CruciusCommand i;
	public static CruciusCommand get() { return i; }
	public CruciusCommand() {	i = this; }
	
	// -------------------------------------------- //
	// COMMANDS
	// -------------------------------------------- //
	
	@SuppressWarnings("Duplicates")
	public void registerCommand()
	{
		
		// -------------------------------------------- //
		// /crucius
		// -------------------------------------------- //
		
		new CommandAPICommand(cmd)
			.withAliases(aliases)
			.withPermission(permission)
			.executes((sender, args) ->
			{
				if (sender instanceof Player)
				{
					Player p = (Player) sender;
					code = plugin.getConvertedPlayerLocale(p);
				}
				Lang lang = Lang.read(code);
				sender.sendMessage(lang.getMessage(Messages.SPACER_UPPER, new String[]{lang.getMessage(Messages.CRUCIUS).toUpperCase()}));
				sender.sendMessage(lang.getMessage(Messages.INFO1, new String[]{plugin.getDescription().getName(), plugin.getDescription().getVersion()}));
				sender.sendMessage(lang.getMessage(Messages.INFO2, new String[]{"" + plugin.getDescription().getAuthors()}));
				sender.sendMessage(lang.getMessage(Messages.INFO3, new String[]{plugin.getDescription().getWebsite()}));
				if (sender.hasPermission("crucius.basecommand.help"))
					sender.sendMessage(lang.getMessage(Messages.INFO4, new String[]{"/" + cmd + " help"}));
				sender.sendMessage(lang.getMessage(Messages.SPACER_LOWER, new String[]{lang.getMessage(Messages.CRUCIUS).toUpperCase()}));
			}).register();
...

Expected behavior Let me execute the command

Additional context The same problem persists when I try the command inside the console

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Comments: 18 (9 by maintainers)

Commits related to this issue

Most upvoted comments

Hi, I am in the process of releasing version 3.1 which fixes this. I hope to release it within the next 24 hours