Skip to content

CommandPermission.fromString doesn't provide suggestions #73

@JorelAli

Description

@JorelAli

CommandAPI version
v2.2

Minecraft version
1.14.4

Describe the bug
Using CommandPermission.fromString() to provide a permission node doesn't work as intended when using the GroupManager permission system. The text remains red when typing (should provide context and show argument colors such as aqua and light yellow), yet the command will run normally and work. Suggestions also don't work.

My code
This code reproduces the behavior:

LinkedHashMap<String, Argument> args = new LinkedHashMap<>();
args.put("player-name", new PlayerArgument());
args.put("message-text", new GreedyStringArgument());

CommandAPI.getInstance().register("test", CommandPermission.fromString("debug.command.sendmessage"), args, (commandSender, objects) -> {
    final Player player = (Player) objects[0];
    final String message = (String) objects[1];
    player.sendMessage(ChatColor.translateAlternateColorCodes('&', message));
});

Expected behavior
Commands work as you'd expect them to, with suggestions and color highlighting

Screenshots
image

Additional context
Originally posted by @portlek in #66 (comment)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions