SkQuery [1.13-1.21+]

Addon SkQuery [1.13-1.21+] 4.3.2

  • 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 community!

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

Fixed:
  • Some compare classes not working in some cases.
  • Some null pointers
  • Fixed up some Lamba things
  • Changed how some things work, no noticeable difference.
Added:
  • A DEV_LIME boolean field for developers to tell if the server is running this fork.
  • A DISABLE_YAML boolean field for developers to disable SkQuery's yaml. Skellett uses this.
  • A method to disable the Yaml of SkQuery. SkQuery.disableYaml(boolean)
  • All these above are in the SkQuery.class
  • Added the ability to control Lamba's internally better (Developers addition)
  • Added a for each effect. This allows you to do multiple things with a lamba and lists
    code_language.skript:
    %objects% for each %lambda%
    
    and
    
    %objects% where %predicate% for each %lambda% respectively
    The respectively makes the effect run double/triple/quad/infinite condition and effects simultaneously. So if the first lamba condition is true, it will run the first lamba effect. If the seventh lamba condition is true, it will run the seventh lamba effect etc.
  • Added beta testing lamba expressions. Was playing around with these. They shouldn't interfere or be visibly usable at the moment.
  • Re-added MySQL options and stuff for the time being. Revamping this later in it's own addon maybe.
Examples:

code_language.skript:
function getConnectedBlocks(block: block):
    add {_block} to {return::*}
    loop all blocks in radius 1 around location of {_block} where [type of block input is type of {_block}]->[{return::*} doesn't contain block input]:
        add loop-value to {return::*}
        getConnectedBlocks(loop-value)
command /replace <item> <number> <item>:
    trigger:
        set {_now} to now
        getConnectedBlocks(target block)
        {return::*} where [chance of argument 2%] for each [set block at block input to argument 1]->[set block above block input to argument 3]
        broadcast "%difference between now and {_now}%"
        delete {return::*}
command /change <item>:
    trigger:
        set {_now} to now
        getConnectedBlocks(target block)
        {return::*} for each [set block at block input to argument]->[set block above block input to argument]
        broadcast "%difference between now and {_now}%"
        delete {return::*}
command /test:
    trigger:
        "this", "test.", "test2.", "is" and "dope" where [string input doesn't contain "."] for each [set string input to "&6%string input%"]->[broadcast "%string input% + %loop input%"]
command /assigner:
    trigger:
        all players where [size of {team::red::*} > {team::blue::*}]->[size of {team::blue::*} > {team::red::*}] for each [broadcast "&c&l%player input% is now on blue"]->[broadcast "&c&l%player input% is now on red"] respectively

The last respectively syntax adds the player to red if it's low or adds them to blue if the team is low occupied. I can help people understand the for each more if you PM me on SkUnity, Spigot or Discord, or you can just tag me.

This is probably the last update for awhile until 1.13 breaks this addon.
Fixed an error that crashed SkQuery with latest Bensku's edit dev-32. I predicted this was going to happen so I had this made for myself awhile ago.
  • Added the ability to get the number/integer input of the "evaluate lamba" effect from the last update.
Example:
code_language.skript:
do 5 times [broadcast "This is the %number input% loop"]

P.S: If anyone wants the Lamba hotfix for Skript-Mirror users. Just PM me for that fix of this build.
  • Like
Reactions: Goetheus
Fixed:
  • Fixed some minor bugs.
  • Fixed some null pointers.
  • Updated the main thread with more info about the build.
  • Fixed pop firework (Not client side anymore) but works.
code_language.skript:
#Changed syntax from
pop %fireworkeffects% at %locations% to %players%

#to

(detonate|pop) %fireworkeffects% at %locations%

Added:
  • Added some fixes/improvements from VirusTotal's edit.
  • Added the ability for the "evaluate lamba" to execute multiple times.
code_language.skript:
do [%-number% time[s]] %lambda%

Examples:
code_language.skript:
do [broadcast "message 1 time"]

do 5 times [broadcast "message 5 times"]

pop ball large firework coloured red at player's location

pop ball firework coloured blue, yellow and light green at player
  • Like
Reactions: Goetheus and Hobbes
Added:
- Added former movement location. Uses the getFrom() in the on any movement that never existed.
code_language.skript:
([the] (past|former) move[ment] [location]
- Added settable relative option to the time relative syntax.
code_language.skript:
(relative|player) time of %player% [with relative %-boolean%]

#or

%player%'s (relative|player) time [with relative %-boolean%]

Fixed:
- Fixed Time Relative throwing null when trying to reset http://skunity.com/search?search=time+rel#
- Fixed the where filter expression not working. (Throws some errors if the predicate contains an unknown expression/value. Looking into fixing that.)
- Fixed some minor bugs.

Example script:

code_language.skript:
function isInSwamp(p: player):
    loop all players where [distance between {location} and {_p} <= 10]:
        message "&2Get out of my Swamp!" to loop-player
command /where:
    trigger:
        loop all players where [player input is "LimeGlass" parsed as player]:
            message "&aOh hi there Lime" to loop-player
function flyingEntities(empty: boolean = false) :: entities:
    return all entities where [ground state of entity input is false]
function betterContains(objects: objects, contains: object) :: boolean:
    if {_objects::*} where [object input is {_object}] is empty:
        return false
    else:
        return true
command /test:
    trigger:
        set {_objects::*} to "Stuff", "Test", "Skript" and "Testing"
        if betterContains({_objects::*}, "Testing") is true:
            broadcast "yes"
        else:
            broadcast "no"
Fixed the fireworks system not working at all since Gatt's 1.9 SkQuery edit.

Added colour support to the firework syntax. For everyone not American xD

Fixed some minor bugs.

Modified Syntax:

code_language.skript:
#Main launch effect:
    (launch|deploy) %firework effects% at %locations% (with duration|timed) %number%

#%firework effect%:
    (1¦|2¦flickering |3¦trailing |4¦flickering trailing |5¦trailing flickering )%firework type% [firework] [effect] colo[u]red %colors%

    (1¦|2¦flickering |3¦trailing |4¦flickering trailing |5¦trailing flickering )%firework type% [firework] [effect] colo[u]red %colors% fad(e|ing) [to] %colors%

#%firework types%:
    ball, ball large, burst, creeper, star

Firework examples:
code_language.skript:
command /fireworks:
    trigger:      
        launch flickering ball firework colored red at player's location timed 0
        wait a second
        launch trailing ball large coloured red, blue and green at player's location timed 1
        wait a second
        launch flickering trailing creeper coloured green fading to red, black and green at player's location timed 1
        wait a second
        launch trailing flickering star coloured purple and red fading to pink at player's location timed 1
Changed:
code_language.skript:
make %livingentities% pathfind to %location% with speed %number%
#to
make %livingentities% pathfind to %location% (with|at) speed %number%

Added:
- Metrics https://bstats.org/plugin/bukkit/SkQuery

Fixed:

- Some minor bugs
Added the ability to stop a midi while it's playing.
code_language.skript:
stop midi [id] %string%

The ID will be the string input used to get the midi file. If you're using the web midi player it will use that at the stop string too.


code_language.skript:
play midi "This" to player
wait 5 seconds
stop midi "This"
Fixed:
- A Yaml bug that generated folders instead of the file when using SkQuery??? This happened when the yaml file didn't exist.
- Made a create file system if trying to set yaml to a file that doesn't exist
- Fixed more bugs
- Fixed some null pointers

Nothing is new or noticable. Just some bugs I found while doing heavy testing.

I also found a few more bugs that haven't been fixed yet. Still looking into it and fixing them.

Enjoy :emoji_grinning:

By the way to anyone wondering. Yes this SkQuery version should work on most server versions, not just 1.11+