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 Target Selectors [ALPHA!]

Discussion in 'Scripts' started by Lego_freak1999, Mar 31, 2020.

  1. Lego_freak1999

    Lego_freak1999 Well-Known Member

    Joined:
    Jan 26, 2017
    Messages:
    664
    Likes Received:
    45
    Warning!
    Don't use this api as a dependency! I need some feedback to resolve possible bugs to make this a stable api.

    This api allows u to use vanilla minecraft command target selectors as expressions or arguments in skript.

    A target selector is used to target players or entities in your game commands. There are 5 target selectors that you can choose from.

    More info:
    https://www.digminecraft.com/getting_started/target_selectors.php

    1.13 or up.
    @a, @p, @e, @r, @s.
    all selector tags like [distance], [name], [type].
    player, command_block and console executers.

    Bukkit 1.13+ (and ofc Spigot/Paper also work since they based on bukkit)
    Skript 2.4 https://github.com/SkriptLang/Skript/releases
    Skript-Mirror 2.0.0 https://skripttools.net/dl/skript-mirror+2.0.0-SNAPSHOT.jar

    Code (Text):
    1.  
    2. Expressions:
    3. @(a|e|p|r|s)[\[<(.+)>\]] from %command sender%
    4. [@]%object% from %command sender%
    5.  

    Code (Text):
    1.  
    2.  
    3. #Looping a Basic selector
    4.  
    5. command /example1:
    6.     trigger:
    7.         loop @a from command sender:
    8.             send "Hi!" to loop-selected
    9.  
    10. #Basic selector
    11.  
    12. command /example2:
    13.     trigger:
    14.         send "Hi!" to @a from command sender
    15.  
    16. #Basic selector2
    17.  
    18. command /example3:
    19.     trigger:
    20.         send "Hi!" to @p from command sender
    21.  
    22. #Basic argument selector
    23.  
    24. command /example4 <text>:
    25.     trigger:
    26.         send "Hi!" to @arg 1 from command sender
    27.  
    28. #Looping a Basic selector and getting its location
    29.  
    30. command /example5:
    31.     trigger:
    32.         loop @e from command sender:
    33.             set {_s} to loop-selected #Need to set to a var first bc of a bug
    34.             send "%{_s}% %location of {_s}%" to @a from command sender
    35.  
    36. #Advanced selector
    37.  
    38. on right click on netherrack:
    39.     send "Hello everybody close by!" to @a[distance=0..10] from player
    40.  
    #More info about the bug:

    Fixing expected bugs.

    Suggestions? (No 1.12 or lower support expected.)
     
  2. mtrD359360

    mtrD359360 Member

    Joined:
    May 2, 2017
    Messages:
    17
    Likes Received:
    1
    Hello, I'm making some skript on a server running 1.12.2. Could you please make this API or maybe Skript addon to be compatible to at least 1.12 or above? Thank you!
     

Share This Page

Loading...