SkQuery [1.13-1.19+]

Addon SkQuery [1.13-1.19+] 4.1.10

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

Welcome to SkQuery 4.1, this is the complete SkQuery story, adding all elements from the SkQuery 4 (pre1 and pre2) (Except Advancements and Npcs (Ok it's hard to maintain NMS)).

Added:
  • Added the ability for Tab Completions to work regardless of their capitalization. (Thanks PanGargamel #12)
  • Added Expression to get characters at indices from strings:
    • Code:
      char[acter][s] at [index] %numbers% (within|in) %strings%
  • Added inventory name event expression:
    • Code:
      inventory name
    • Example:
      Code:
      on inventory click:
          broadcast "%inventory name%"
  • Added WorldBorder expressions. Type name: worldborder
    • World border center:
      • Code:
        center of [world[ ]border[s]] %worldborders%
        
        %worldborders%'[s] [world[ ]border[s]] center
  • World border time:
    • Code:
      warning time of [world[ ]border[s]] %worldborders%
      
      %worldborders%'[s] [world[ ]border[s]] warning time
  • World border distance:
    • Code:
      warning distance of [world[ ]border[s]] %worldborders%
      
      %worldborders%'[s] [world[ ]border[s]] warning distance
  • World border damage amount:
    • Code:
      damage [amount] of [world[ ]border[s]] %worldborders%
      
      %worldborders%'[s] [world[ ]border[s]] damage [amount]
  • World border damage buffer:
    • Code:
      [damage] buffer of [world[ ]border[s]] %worldborders%
      
      %worldborders%'[s] [world[ ]border[s]] [damage] buffer
  • World border size:
    • Code:
      (size|diameter) [over [a [(time|period) of]] %-timespan%] of [world[ ]border[s]] %worldborders%
      
      %worldborders%'[s] [world[ ]border[s]] (size|diameter) [over [a [(time|period) of]] %-timespan%]
  • Added WorldBorder locations within condition:
    • Code:
      %locations% is [with]in [world[ ]border[s]] %worldborder%
      
      %locations% (isn't|is not) [with]in [world[ ]border[s]] %worldborder%
  • Added trail projectile:
    • Can only be used within the on shoot event
    • Data's aren't supported because the VisualEffect isn't accessible without parsing an expression to addons, and I haven't made a particle library yet.
    • Code:
      trail projectile with %particles%
Fixed:
  • Fixed "Entity has potioneffect" condition to support multiples:
    • Before:
      Code:
      %livingentity% (has|have) %potioneffecttype%
      
      %livingentities% does(n't| not) (has|have) %potioneffecttype%
      Before
    • After:
      Code:
      %livingentities% (has|have) [potion [effect]] %potioneffecttypes%
      
      %livingentities% (doesn't|does not|do not|don't) have [potion [effect]] %potioneffecttypes%
  • Fixed Divisible condition to support multiples:
    • Before:
      Code:
      %number% is divisible by %number%
      
      %number% is not divisible by %number%
    • After:

      Code:
      %numbers% (is|are) divisible by %number%
      
      %number% (isn't|is not|aren't|are not) divisible by %number%
  • Fixed Prime condition to support multiples:
    • Before:
      Code:
      %number% is [a] prime [number]
      
      %number% %number% is not [a] prime [number]
    • After:
      Code:
      %numbers% (is|are) [a] prime [number]
      
      %numbers% (isn't|is not|aren't|are not) [a] prime [number]
  • Fixed a syntax mistake where "not" in:
    Code:
    %itemtype% (isn't|is not) not [a] block
    • should be:
      Code:
      %itemtype% (isn't|is not) [a] block
    • My guess is that this has always existed in SkQuery.
  • Fixed inventory name in 1.13+ with some changes to how you are going to be able to get it.
    • So in 1.13+ Spigot removed the ability to get the title of inventories, unless they're a container or an InventoryView.
    • Meaning SkQuery can only implement those ways, so the new ways to get the inventory name are the event value "inventory name" within the inventory click event.
    • Example:
      Code:
      on inventory click:
          event-inventory is not player's inventory
          inventory name is "example"
          cancel event
    • The other way it's implemented is if the inventory has a holder aka a container being a block:
      Code:
      on block break:
          if inventory name of inventory of event-block is "example":
              cancel event
    • Keep in mind doing name of %inventories% will go to Skript in which the newest Skript versions just outright removed the ability to grab the name.
      • So be advised it's not SkQuery not working if you don't add inventory name before.
    • Using the inventory name expression in versions lower than <1.13 will act normal prior to this update.
    • This should still work assuming it's the event-inventory in an inventory click event as well:
      Code:
      on inventory click:
          event-inventory is not player's inventory
          broadcast inventory name
          broadcast inventory name of event-inventory
    • It's a bad way to check inventories against their name, so as an alternative you can add a player to a variable list:
      Code:
      on script unload:
          delete {inventories::temp::*}
      
      command /example:
          trigger:
              set {_inventory} to chest with 2 rows named "example"
              set slots 4 and 13 of {_inventory} to light green stained glass pane named "&bSkQuery" with lore "&2&lLine 1" and "&6Line 2"
              add player to {inventories::temp::example-opened::*}
              open {_inventory} to player
      
      on inventory click:
          event-inventory is not player's inventory
          broadcast inventory name
          broadcast inventory name of event-inventory
          {inventories::temp::example-opened::*} contains player
          cancel event
          if index of clicked slot is 4 or 13:
              broadcast "&bYou clicked the SkQuery example."
      
      on inventory close:
          remove player from {inventories::temp::example-opened::*}
      
      on disconnect:
          remove player from {inventories::temp::example-opened::*}

Hope you enjoyed this semi-big update. Let us know if you find any bugs at https://github.com/SkQuery/SkQuery/issues

If you're a developer and wanna contribute to SkQuery you can do so at our repo https://github.com/SkQuery/SkQuery/pulls

Version naming is 4.1 as 4 already exists and this includes all of v4 which wasn't that much to be honest. Most of it is in vanilla Skript now.

Enjoy.
  • Like
Reactions: bertek41
  • Removed fireworks, I added them to Vanila Skript. (Pop firework still exists though as that's reflection)
  • Removed BookOf expression, it generated a book by string, it was a dumb implementation. Books are in Vanila Skript now.
  • Removed SkQuery version expression, not needed.
  • Fixed Skript 2.3 color issues.
Started experimental documentation http://skquery.github.io

SkQuery is now a Github organization, report bugs here https://github.com/SkQuery/SkQuery/issues
Added:
  • Midi is playing condition;
Code:
midi [ids] %strings% (are|is) playing

midi [ids] %strings% (are|is)(n't| not) playing
  • Location is within now accepts multiple locations;
Code:
%locations% (is|are) within %location% (to|and) %location%

%locations% (are|is)(n't| not) within %location% (to|and) %location%
  • Revamped the whole Midi system, made it sound better, use 1.12 sounds, and performance boost (Will default to 1.8 sounds when 1.8-1.11 is installed)
  • Added a Util class for maintaining 1.9+ support

Fixed:
  • A null pointer in the Yaml.
  • A null pointer in the Midi system
  • 1.13 sounds and deprecated methods not working.
  • Changed some deprecated methods to work for both those deprecated methods and new methods in case the user is either running on 1.8 or 1.13+
  • Fixed the stop midi effect not working sometimes.
  • Fixed 1.13 issues with Materials.

Removed:
  • Removed the old v1 Visualizer system (Not Format slot, that's v2)
  • Moved all custom util classes into just utils.

Please report bugs at https://github.com/TheLimeGlass/SkQuery/issues
Otherwise myself or other developers will never see the bug report or forget.

I love SkQuery's Midi system way more than NoteBlockAPI to be honest. Always have, always will, sounds much better.

Video demo of the new Midi system;
  • Like
Reactions: bertek41
This version of SkQuery has about 30% of it's code rewritten for better performance. This version has the removal of lore because it collided with vanilla Skript 2.3 versions as it has a lore now. This version is designed to only work with 2.3+ Skript builds.

Let me know if you run into any issues, other than lore, if you run into issues with lore report it on the Skript issue tracker.
It has been awhile since I posted an update for SkQuery, there hasn't been any issues with it, so there is no need to post an update.

A user recently reported that the client sign effect doesn't work, so I fix it and here is that version.

I only have three plans for this fork at the moment.

1.) Re-add all the stuff that was removed over the course of this and Gatt's fork.
2.) Code clean
3.) 1.13 support.

I have done a bit of code clean in the whole system of registering and lots of other places, I can't remember any changes either since it's been so long, no new stuff, all internals.

And lastly, when 1.13 Skript comes out, I will be sure to keep this updated as so many people use it. Thanks again.
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