CommandAPI icon indicating copy to clipboard operation
CommandAPI copied to clipboard

Example - Creating a message broadcasting system has incorrect code block

Open JorelAli opened this issue 3 years ago • 1 comments

Documentation URL

https://commandapi.jorel.dev/8.5.1/normalexecutors.html#example---creating-a-message-broadcasting-system

What the documentation currently says

image

Proposed fix

(Double reference to "normalcommandexecutors3" in Examples.java. Needs renaming and re-linking):

//Create our command
CommandAPICommand("broadcastmsg")
    .withArguments(GreedyStringArgument("message")) // The arguments
    .withAliases("broadcast", "broadcastmessage")       // Command aliases
    .withPermission(CommandPermission.OP)               // Required permissions
    .executes(CommandExecutor { sender, args ->
        String message = (String) args[0]
        Bukkit.getServer().broadcastMessage(message)
    })
    .register()

JorelAli avatar Sep 21 '22 20:09 JorelAli

Fixed in dev/kotlindocs and merged back into dev/dev. Will be fixed in the 8.6.0 released documentation.

JorelAli avatar Oct 03 '22 10:10 JorelAli