Resource icon

Script Tab Completer API 1.2.1

  • Welcome to skUnity!

    Welcome to skUnity! This is a forum where members of the Skript community can communicate and interact. Skript Resource Creators can post their Resources for all to see and use.

    If you haven't done so already, feel free to join our official Discord server to expand your level of interaction with the comminuty!

    Now, what are you waiting for? Join the community now!

Contributors
_JustDylan_
Supported Minecraft Versions
  1. 1.13
Dependence:
skript and skript-mirror

Event for tab completion:
on TabCompleteEvent:
(you will need to import org.bukkit.event.server.TabCompleteEvent)

Effects:
set completions to %texts% at %text%:
example:
- set completeions to {completions::*} at tab arg 2

Expressions:
tabbed command
- returns the tabbed command
tab arg[ument]( |-)%*number%
- returns tabbed argument at argument %number%
buffer
- returns the chat buffer
event.getSender()
- returns the sender

example:
code_language.skript:
#example
import:
    java.io.File
    java.util.Arrays
    org.bukkit.event.server.TabCompleteEvent

expression scripts:
    get:
        set {_directory} to new File("plugins/Skript/scripts/")
        loop ...{_directory}.listFiles():
            add loop-value.getName() to {_scripts::*}
        return {_scripts::*}
on TabCompleteEvent:
    if tabbed command is "/skript" or "/sk":
        if tab arg 2 isn't set:
            set completions to "reload", "enable", "disable", "update" and "help" at tab arg 1
        else:
            if tab arg 3 isn't set:
                if tab arg 1 is "update":
                    set completions to "check", "changes" and "download" at tab arg 2
                else if tab arg 1 is "reload":
                    set completions to scripts, "all", "config", "aliases" and "scripts" at tab arg 2
                else if tab arg 1 is "enable" or "disable":
                    set completions to "all" and scripts at tab arg 2
                else:
                    cancel event
  • Like
Reactions: Diclo
Author
_JustDylan_
Downloads
408
Views
719
First release
Last update
Rating
5.00 star(s) 4 ratings

More resources from _JustDylan_

Latest updates

  1. Small tweaks to skripts expression

    changed expression skripts to scripts because ShaneBee said I'd make more sense
  2. Now compatible with latest updates* 1-2-2019

    It should be compatible with the latest updates of skript and skript-mirror once again.
  3. 1.1.0 Compacted The Skript

    Update log: - Reworked the script, it should now be a lot more compact.

Latest reviews

Works fine on 1.15.2! I had been looking for some way of doing this for over an hour so this really saved me!
I can't understand why this amazing script has so few downloads ><
There's one thing that could be added to make it perfect - light red highlight for incorrect command arguments, like in vanilla commands
Awesome resource, very useful.
Mangos are awesome too.
this is very cool ! :)