Denizen Script Meta Documentation Search


Learn about how Denizen works in The Beginner's Guide.
Showing 6 search results for tab completion out of 3897 meta-documentation entries...

Semi-Strong Match Results



Event


Nameplayer receives commands
Event Lines player receives commands
Triggerswhen the list of available server commands is sent to the player for tab completion.
Generated Examplesafter player receives commands:
Has PlayerAlways. - this adds switches 'flagged:<flag name>' + 'permission:<node>', in addition to the '<player>' link.
Contexts<context.commands> returns a ListTag of received commands.
DetermineListTag to set the player's available commands. NOTE: It is not possible to add entries to the command list, only remove them.
GroupPlayer
Sourcehttps://github.com/DenizenScript/Denizen/blob/dev/plugin/src/main/java/com/denizenscript/denizen/events/player/PlayerReceivesCommandsScriptEvent.java#L15
Nametab complete
Event Lines tab complete
Triggerswhen a player or the console is sent a list of available tab completions.
Generated Examplesafter tab complete:
Has Playerwhen the tab completion is done by a player. - this adds switches 'flagged:<flag name>' + 'permission:<node>', in addition to the '<player>' link.
Switchescommand:<command_name> to only process the event if the command matches the input name.
Contexts<context.buffer> returns the full raw command buffer.
<context.command> returns the command name.
<context.current_arg> returns the current argument for completion.
<context.completions> returns a list of available tab completions.
<context.server> returns true if the tab completion was triggered from the console.
DetermineListTag to set the list of available tab completions.
CancellableTrue - This adds <context.cancelled> and determine 'cancelled' or 'cancelled:false'
GroupServer
Sourcehttps://github.com/DenizenScript/Denizen/blob/dev/plugin/src/main/java/com/denizenscript/denizen/events/server/TabCompleteScriptEvent.java#L18

Semi-Decent Match Results



Language


NameCommand Script Containers
DescriptionCommand script containers allow you to register your own custom commands to the server.
This also allows the command to show up in the '/help' command, with some info on the command.

Note that existing names or aliases from other plugins will be overridden.
If you want to run a script at the same time as an existing command, see Event:on command.

The following is the format for the container.

The required keys are 'name:', 'description:', 'usage:', and 'script:'
All other keys can be excluded if unneeded.
If you are not intentionally setting a specific value for the other keys, it is
strongly recommended that you simply not include them at all.

Please note that 'name:' is the true name of the command (written by users),
and 'usage:' is for documentation in the '/help' command.
These two options should almost always show the same name.


Command scripts can be automatically disabled by adding "enabled: false" as a root key (supports any load-time-parseable tags).


# The name of the script doesn't matter, and will not affect the command in any way.
Command_Script_Name:

    type: command

    # The name of the command. This will be the default method for running the command, and will show in '/help'.
    # | All command scripts MUST have this key!
    name: mycmd

    # The description of the command. This will be shown in the '/help' command.
    # Multiple lines are acceptable, via <&nl> (the tag for a new line), but you should
    # make the first line a brief summary of what your command does.
    # | All command scripts MUST have this key!
    description: My command.

    # Correct usage for the command. This will show in the '/help' command.
    # This is NOT the name of the command, and it is NOT used to control input parsing. It is EXCLUSIVELY for '/help'.
    # | All command scripts MUST have this key!
    usage: /mycmd <&lt>myArg1<&gt>

    # A list of aliases for the command. These will be used as alternative ways to trigger the command, and will show in the '/help' command.
    # | Some command scripts might have this key, but it's optional.
    aliases:
    - myalias
    - mycommand

    # The permission node to check for permissions plugins. This will automatically
    # block players without the permission from accessing the command and help for
    # the command.
    # Note that you can include multiple permission nodes (a player only needs to have any one permission from the list)
    # by separating them with a semicolon, like: perm.one;perm.two;third.perm
    # | Most command scripts should have this key!
    permission: my.permission.node

    # The message to send to the player when they try to use the command without
    # permission. If this is not specified, the default Bukkit message will be sent.
    # Has "permission" def available.
    # | Most command scripts should NOT have this key, but it's available.
    permission message: Sorry, <player.name>, you can't use my command because you don't have the permission '<[permission]>'!

    # The procedure-based script that will be checked when a player or the console
    # is trying to view help for this command. This must always be determined true
    # or false. If there is no script, it's assumed that all players and the console
    # should be allowed to view the help for this command.
    # Available context: <context.server> returns whether the server is viewing the help (a player if false).
    # | Most command scripts should NOT have this key, but it's available.
    allowed help:
    - determine <player.has_flag[special_allowed_help_flag]||<context.server>>

    # You can optionally specify tab completions on a per-argument basis.
    # Available context:
    # <context.args> returns a list of input arguments.
    # <context.raw_args> returns all the arguments as raw text.
    # <context.server> returns whether the server is using tab completion (a player if false).
    # <context.alias> returns the command alias being used.
    # | This key is great to have when used well, but is not required.
    tab completions:
        # This will complete "alpha" and "beta" for the first argument
        1: alpha|beta
        # This will complete any online player name for the second argument
        2: <server.online_players.parse[name]>
        # This will allow flags "-a", "-b", or "-c" to be entered in the third, fourth, or fifth argument.
        3 4 5: -a|-b|-c
        # Any argument other than the ones explicitly listed will be handled here with a tab complete that just says 'StopTyping'.
        default: StopTyping

    # You can also optionally use the 'tab complete' key to build custom procedure-style tab complete logic
    # if the simply numeric argument basis isn't sufficient.
    # Has the same context available as 'tab completions'.
    # | Most scripts should leave this key off, though it can be useful to some.
    tab complete:
    - determine some|dynamic|logic|here

    # The script that will run when the command is executed.
    # No, you do not need '- determine fulfilled' or anything of the sort, since the command is fully registered.
    # Available context:
    # <context.args> returns a list of input arguments.
    # <context.raw_args> returns all the arguments as raw text.
    # <context.source_type> returns the source of the command. Can be: PLAYER, SERVER, COMMAND_BLOCK, or COMMAND_MINECART.
    # <context.alias> returns the command alias being used.
    # <context.command_block_location> returns the command block's location (if the command was run from one).
    # <context.command_minecart> returns the EntityTag of the command minecart (if the command was run from one).
    # | All command scripts MUST have this key!
    script:
    - narrate Yay!
    - narrate "My command worked!"
    - narrate "And I typed '/<context.alias> <context.raw_args>'!"
GroupScript Container System
Sourcehttps://github.com/DenizenScript/Denizen/blob/dev/plugin/src/main/java/com/denizenscript/denizen/scripts/containers/core/CommandScriptContainer.java#L28

Mechanism


Nameadd_tab_completions
ObjectPlayerTag
InputListTag
DescriptionAdds custom tab completions that will be suggested to the player when typing in chat.
Tab completions added by this mechanism can be removed using Mechanism:PlayerTag.remove_tab_completions.
Grouppaper
RequiresPaper
Sourcehttps://github.com/DenizenScript/Denizen/blob/dev/paper/src/main/java/com/denizenscript/denizen/paper/properties/PaperPlayerExtensions.java#L193
Nameremove_tab_completions
ObjectPlayerTag
InputListTag
DescriptionRemoves custom tab completions added by Mechanism:PlayerTag.add_tab_completions.
Grouppaper
RequiresPaper
Sourcehttps://github.com/DenizenScript/Denizen/blob/dev/paper/src/main/java/com/denizenscript/denizen/paper/properties/PaperPlayerExtensions.java#L207

Tag


Name<PlayerTag.tab_completions[<command>]>
ReturnsListTag
DescriptionReturns a list of all tab completions for the given plaintext of a command.
Input is formatted equivalent to if it were typed into a chat bar, minus the '/' slash at the start.
Input must necessarily contain at least one space.
For example: "<player.tab_completions[npc ]>" will return all /NPC sub command names available to the player.
This is only compatible with commands registered in Spigot. Meaning in particular, vanilla commands are not recognized or supported.
Sourcehttps://github.com/DenizenScript/Denizen/blob/dev/plugin/src/main/java/com/denizenscript/denizen/objects/PlayerTag.java#L2527