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!

Dismiss Notice
This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Script Tab Completer API 1.2.1

this code creates effects and expressions that can be used to create a custom tab completer

  1. _JustDylan_
    Contributors:
    _JustDylan_
    Supported Minecraft Versions:
    • 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 (Skript):
    1.  
    2. #example
    3. import:
    4.     java.io.File
    5.     java.util.Arrays
    6.     org.bukkit.event.server.TabCompleteEvent
    7.  
    8. expression scripts:
    9.     get:
    10.         set {_directory} to new File("plugins/Skript/scripts/")
    11.         loop ...{_directory}.listFiles():
    12.             add loop-value.getName() to {_scripts::*}
    13.         return {_scripts::*}
    14. on TabCompleteEvent:
    15.     if tabbed command is "/skript" or "/sk":
    16.         if tab arg 2 isn't set:
    17.             set completions to "reload", "enable", "disable", "update" and "help" at tab arg 1
    18.         else:
    19.             if tab arg 3 isn't set:
    20.                 if tab arg 1 is "update":
    21.                     set completions to "check", "changes" and "download" at tab arg 2
    22.                 else if tab arg 1 is "reload":
    23.                     set completions to scripts, "all", "config", "aliases" and "scripts" at tab arg 2
    24.                 else if tab arg 1 is "enable" or "disable":
    25.                     set completions to "all" and scripts at tab arg 2
    26.                 else:
    27.                     cancel event
    28.  

Recent Reviews

  1. iDarkyy
    iDarkyy
    5/5,
    Version: 1.0.1
    Awesome resource, very useful.
    Mangos are awesome too.
  2. IHaxMC
    IHaxMC
    5/5,
    Version: 1.0.1
    this is very cool ! :)