Skip to content

SkQuery 4-pre1 and 4-pre2 additions

Choose a tag to compare

@TheLimeGlass TheLimeGlass released this 12 Jul 07:16

SkQuery:
Welcome to SkQuery 4.1, this is the complete SkQuery story, adding all elements from the SkQuery 4 (pre 1 and pre 2) (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 indexes from strings.
- 'char[acter][s] at [index] %numbers% (within|in) %strings%'
- Added inventory name event expression.
- Added WorldBorder expressions. Type: worldborder
- World border center center of [world[ ]border[s]] %worldborders%, %worldborders%'[s] [world[ ]border[s]] center
- World border time warning time of [world[ ]border[s]] %worldborders%, %worldborders%'[s] [world[ ]border[s]] warning time
- World border distance warning distance of [world[ ]border[s]] %worldborders%, %worldborders%'[s] [world[ ]border[s]] warning distance
- World border damage amount damage [amount] of [world[ ]border[s]] %worldborders%, %worldborders%'[s] [world[ ]border[s]] damage [amount]
- World border damage buffer [damage] buffer of [world[ ]border[s]] %worldborders%, %worldborders%'[s] [world[ ]border[s]] [damage] buffer
- World border size (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 condition:
- Locations are within Border %locations% is [with]in [world[ ]border[s]] %worldborder%, %locations% (isn't|is not) [with]in [world[ ]border[s]] %worldborder%
- Added trail projectile trail projectile with %particles%
- Can only be used within the on shoot event

Fixed:
- Fixed Entity has potioneffect condition to support multiples:
- Before %livingentity% (has|have) %potioneffecttype%, %livingentities% does(n't| not) (has|have) %potioneffecttype%
- After %livingentities% (has|have) [potion [effect]] %potioneffecttypes%, %livingentities% (doesn't|does not|do not|don't) have [potion [effect]] %potioneffecttypes%
- Fixed Divisible condtion to support multiples:
- Before %number% is divisible by %number%, %number% is not divisible by %number%
- After %numbers% (is|are) divisible by %number%, %number% (isn't|is not|aren't|are not) divisible by %number%
- Fixed Prime condtion to support multiples:
- Before %number% is [a] prime [number], %number% %number% is not [a] prime [number]
- After %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 %itemtype% (isn't|is not) not [a] block should be %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 their a container or an InventoryView.
- Meaning SkQuery can only implement those ways, so the new ways to get the inventory name are inventory name within the inventory click event
on inventory click:
clicked 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.
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 adviced 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.
- This should still work assuming it's the event-inventory in an inventory click event aswell
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.
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
			{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::*}