TuSKe - Custom Enchantments, GUI Manager and more!

Addon TuSKe - Custom Enchantments, GUI Manager and more! 1.8.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 comminuty!

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

  • Fixed conflicts with Skript dev32+.
  • Fixed issues from issues tacker.
  • Added support to use a list of permissions in execute command with permission effect.
    Example:
    code_language.skript:
    execute player command "/cmd" with permissions "first.permission" and "second.permission"
Internal changes:
  • Changed documentation generator system, cleaned the code and added support for other types of files (markdown, json and yaml).
  • Added an ID field for docs generator, useful for external docs tools. (Thanks to @eyesniper2)
  • Fixes for gui manager system.
  • Using gradle as dependency manager.
  • Changed the package from me.tuke.sktuke to com.github.tukenuke.tuske.
[+] Added:
  • Added support for on break event in effect cancel drops. It allows you to prevent the drops of event-block. (For 1.12+ only)
[+] Fixed:
  • Fixed a issue with Advanced GUIs caused by the last update. If you are in TuSKe 1.8 and use advanced guis, it's recommended that you update it.
  • Some final fixes for Recipe Manager: Shapeless recipe now works fully to accept custom ingredients.
  • Also some fixes for recipes for 1.11.2 and lower: Due to code mistake, it wasn't properly checking its version, causing some console errors when registering recipes. It affects if you are in 1.12 too, due to key change of recipes from bukkit:%random uuid% to tuske:%increasing number (See last update changelog about it).
Special thanks to @X0Freak for donating to TuSKe.
[+] Added:

  • Expressions to create knowledge books containing recipes:
    code_language.skript:
    #A list of recipes of a knowledge book. Can be edited.
    knowledge(s| recipes) of %itemstack%
    %itemstack%'[s] knowledge(s| recipes)
    
    #Returns a knowledge book with given recipes
    %itemstack% with [recipes] %recipes%
  • Added a syntax filter for evaluate effect. Read more about it at documentation or in TuSKe's config file.
  • Added support for version dependent stuffs (player data expression...).
  • Added support for 1.12 recipes:
    • It keeps the same if you are in 1.11.2 or lower, but now the recipes has ids and the recipes must be registered at server startup (in script/skript load event). Why? Because if a player joins a server and he has a recipe knowledge that was registered by TuSKe and it wasn't registered yet, it will spam your console saying that the recipe with id X couldn't be found. So to avoid it, you will need to register all your recipes at server startup.
    • Custom recipes doesn't show up in recipe book. Why? I don't know, maybe Bukkit forgot about it?
    • Since the recipes had some changes in 1.12 and they are supported now in TuSKe, if you used previous version in 1.12 server you might see some console spam saying that couldn't find a recipe X. This is because every TuSKe recipe will be registered with id tuske:%last recipe id + 1%, while previously bukkit registered them as bukkit:%random uuid%.
    • Added a simple expression to get the id and plugin owner of a recipe:
      code_language.skript:
      recipe id of %recipe% #For TuSKe it will return as 'tuske:%number%' while for vanilla as 'minecraft:%result item name%'
      recipe owner of %recipe% #It returns the plugin that registered this (old plugins will return as 'Bukkit') or vanilla recipe

[=] Changed:
  • The slot parameter in effects from simple gui (format a gui slot ...) now is optional, which means it will format the next avaliable slot (not formatted yet).
    code_language.skript:
    format gui slot of player with stone #It will set the slot 0
    format gui slot of player with stone #It will set the slot 1
    #And so on...
  • Also, just another option, if you use value -1 it will format last slot id + 1.
    • Why -1? Because this is the only avaliable id (since slot goes from 0 to ...), and to not gets more confusing adding more syntaxes and stuffs.
      code_language.skript:
      format gui slot 10 of player with stone #Normal, slot 10
      format gui slot -1 of player with stone #It will get the last slot + 1, in this case, slot 11.

[#] Fixed:

  • Fixed issues for the effects with section, if the code inside of a section contains a delay effect (wait effect for example), it will wait the whole trigger instead of jumping to outside of section.
    • Currently only the create gui and evaluate effect was affected by this.
  • Fixed the expression rarity of %custom enchantment% not being registered.
  • Fixed some conflicts between types values.
  • Fixed ingredients of %recipe% not working for 1.12 due to API changes.
  • Fixed custom shapeless recipes not working properly in some cases.
  • Simple GUIs and Advanced GUIs shares the same new click listener: it disables itself and doesn't conflict with Skript when cancelling it.
  • Fixed local variables not working in run when close gui effect.
  • Fixed a long load time due to a issue while saving the config.
Wow, that's the hugest fixes list I've released. Just download it above or uses /tuske to update.
[#] Fixed issue with conflicts between inventory type and gamemode (both had same value: creative). It's important to update it even if you didn't have that issue yet.
[#] Fixed a console error with format a gui slot ... to run gui event from last update.
[+] Added:
  • GUI Manager 2: New features, new syntaxes, faster and better. See the new tutorial
  • Option to remove a specific recipe.
    code_language.skript:
      remove all recipes of {_tool} from all recipes
      loop all recipes of {_tool}:
          remove loop-recipe from all recipes
      -
      loop all recipes of {_tool}:
          delete loop-recipe #Remove from server
          reset loop-recipe #In case it is a custom recipe, it will delete only the custom recipe, 
          #remainning the default vanilla recipe (where it only checks the id and data).
  • New evaluate effect: Some additions compared the one from SkQuery.
    Syntax:

    code_language.skript:
      evaluate [logging [[the] error[s]] in %variable list%]: (%strings%|<.+>)

    Description:

    It allows you to parse a string as skript code and execute it. The main difference is that it does support multiple lines at once and can be parse a code from a section, examples:
    code_language.skript:
      evaluate: "kill player" 
      evaluate: "broadcast ""Hello""" #Using quotes
      evaluate: broadcast "Hello" #Quotes not needed, it can parse directly from it
    
      set {_effect} to "send"
      evaluate:
          if player is a op:
              %{_effect}% "True" #Before parsing the code, it will convert all expressions/variables to text
    
      evaluate logging errors in {_errors::*}: "this is not a valid Skript effect/condition"
      if {_errors::*} is set: #It will contains a skript error
          loop {_errors::*}:
              send loop-value
              # The error message format is:
              # <Error message>: <wrong expression> (TuSKe/evaluate.sk, line <line of code>, '<whole line>')
              # The file 'TuSKe/evaluate.sk' is fictitious, it doesn't create one.
  • Added documentation generator for all addons.
    • It will create a file containing everything from a addon separated.
    • Some useful informations like return type and changers of an expression, event values of an event and the possible values of a type. All types have its own file separated since is not possible to determine which addon it is from.
    • Also, there is a new online documentation at wiki page. This is a working progress of automatic documentation generator.
  • Added new event for SimpleClans:
    code_language.skript:
        [on] clan chat:
            #It is called when a player say something in private clan chat.
            player: Who sent the message
            event-clan: The clan, the same as "player's clan"
            event-string: The message. Currently it can't be setted (I forgot about that). Next release I will make a expression for it
            cancellable
[=] Changed
  • Better performance changes.
    • More self triggable stuffs. What does it means? Some stuffs that are only enabled when they are beeing used.
      • The custom events (on anvil merge, on anvil rename, on inventory move ...) is one of example above. Before, those events were based of inventory click event, where it was checking this event even when you are not using the custom events. But now, the listener is disabled if you are not using them.
      • The GUI Manager also follow that rules: It will only use the inventory click event when there is a GUI open. How does it works?
        • A GUI is opened to a player > The inventory checking is enabled for a single the player > The player closes the GUI > The inventory checking is disabled.
      • Some internal stuffs that uses that idea.
[#] Fixed:
  • Fixes for Recipe Manager:
    • Throwing a console error when registering a shaped recipe.
    • Shapped recipes that are lower than 3x3 was returning missing air ingredients in ingredients of %recipe%.
    • Items with same ingredients (id an data) but with different nbt (name, lore ...) weren't working properly when crafting, now it does. But a warning
      • It has a visual bug when you have the condition above and you switch the ingredients to make 2 recipes different, sometimes the result item becomes invisible, but the item still there. I tried using update inventory of player but no success.
  • all commands was returning Skript commands as skript:<command>.
  • Fixed the updater, sometimes it doesn't check the version properly.

If you didn't have problems with the updater, just execute /tuske update plugin or install it manually.
[#] Fixed effects/expressions that was using a function in it (evaluate function and gui manager):
  • Throwing a error in case you were using new parser from Bensku's fork.
  • The function getting the last value in a loop.
[#] Fixed effects/expressions related to functions:

Some effects was using a workaround to make possible to get a function (in GUI Manager specifically) and it was bugging sometimes when the function has complex parameters (more than one parameter or/and list parameters).
For GUI Manager: Now it's possible to run a function even if it wasn't loaded yet or is below the code.
So it's possible to make like this:
code_language.skript:
make gui slot 0 of player with stone to run function doSomething()
#Som lines below...
function doSomething(i: int = 1):
    broadcast "Hello there!"
Or call the own function that the effect is inside:
code_language.skript:
function openGUI(p: Player, type: String):
    if arg is "1":
        open virtual chest inventory named "Example 1" to {_p}
        make gui slot 0 of {_p} with stone named "Go to page 2" to run function openGUI({_p}, "2")
    else if arg is "2":
        open virtual chest inventory named "Example 2" to {_p}
        make gui slot 0 of {_p} with stone named "Go back to page 1" to run function openGUI({_p}, "1")
[+] Added an expression to get the last attacker of a entity.
code_language.skript:
last attacker of %entity%
%entity%'[s] last attacker
Note: There is a possibility to this expression return a block, I tried some damages that is caused by blocks and I couldn't make it detect the Block. I'm not sure if it is normal or was fixed in new Spigot releases.
This expression returns null if the entity didn't get any damage yet or wasn't caused by a entity.
code_language.skript:
on damage:
    send "%last attacker of victim%" to victim
    wait a tick
    send "%last attacker of victim%" to victim #The last attacker will be the 'attacker' because it is a tick later.
I was off for a few months ago, and I couldn't make weekly updates. But here I am.

Some of these things aren't new if you was using some beta releases. I plan to release some beta versions before release some big stuffs, so if you want to know what's new, just check there.

Tl;DR:
  • Recipe support.
  • Damage modifiers.
  • A regex type.
  • Added general stuffs.
  • Fixed lot of things.

[+] Added full recipe support. Minecraft doesn't check for name and lore of ingredients of a recipe. So, with that I decided to make some stuffs to make it possible
So far, check out this wiki to see some informations about it.
code_language.skript:
#Effects
(create|register) [new] [custom] shaped recipe with (return|result) %itemstack% using [ingredients] %itemstacks% [with shape %strings%]
(create|register) [new] [custom] shapeless recipe with (return|result) %itemstack% using [ingredients] %itemstacks%
(create|register) [new] [custom] furnace recipe with (return|result) %itemstack% using [source] %itemstack% [with experience %number%]

#Expressions:
[the] shape of %recipe%
[the] furnace level of %recipe% #This and the one above isn't too much necessary, just in case you want some recipe's info.
recipe from ingredients %itemstacks%

Note: Soonly, the expression result item of %itemstacks/recipe% won't accept the itemstacks anymore. Use recipe from ingredients %itemstacks% instead.
code_language.skript:
#Previously:
set {_resultItem} to result item of stone #will return a stone buttom
#Now:
set {_resultItem} to result item of recipe from ingredients stone

Note 2: In the effects to register a shaped or shapeless recipe, you need to include the custom in the pattern, so it will accept custom ingredients.

[#] Fixed the expression recipe from ingredients %itemstacks% (previously result item of %itemstacks%), not it can detect most of recipes easily only by its ingredients.

[+] Added a expression to get damage modifiers.
It is used in on death event.

code_language.skript:
damage [modifier] %damage modifier%

Type:
Damage modifier:
absorption - This represents the damage reduction caused by the absorption potion effect.
armor - This represents the damage reduction caused by wearing armor.
base - This represents the amount of damage being done.
blocking - This represents the damage reduction caused by blocking, only present for Players.
hard hat - This represents the damage reduced by a wearing a helmet when hit by a falling block.
magic - This represents the damage reduction caused by the combination of: Armor enchantments Witch's potion resistance
resistance - This represents the damage reduction caused by the Resistance potion effect.

Example:

code_language.skript:
on damage:
   if damage magic is set:
       clear damage magic #Will set the value to 0
   else if damage armor is set:
       add 10 to damage armor

You can add, remove and set values, clear/delete values is the same to set to 0 and reset will set the value to the first value before all changes.

[+] Added a type %regex%. It is used in regex expressions to parse the regex pattern. Also added an expression to check what was wrong on last pattern.

code_language.skript:
#Expression:
[last] regex [parser] error

#Example
set {_regex} to "(.*" parsed as regex
if last regex parser error is set:
   send regex error to player #It will show that the pattern doesn't have a closing bracket.
set {_result} to regex replace "(.*)" with "$3" in "whatever"
if last regex parser error is set:
   send regex error to player #It will send that there isn't any group 3 in the pattern.

So this include to make a little change in all stuffs related to regex. to accept %string/regex% in the pattern, like
code_language.skript:
%string% [regex] matches %string/regex%

[+] Added general stuffs.
code_language.skript:
#Expression:
file [location] of command %string%
command %string%'[s] file location

offline player from [uuid] %string% #Only necessary in case you don't have latest Bensku's fork.
[jukebox] record of %block% #Returns an itemstack, you can set it, but only the material, setting to air make the song stop

#Effect:
eject record [(of|from)] %block% #Stop the song and pull the record off

[=] Changes:
code_language.skript:
#From
[all] commands
#To
[all] [registered] [script] commands

If you use script in the pattern, the expression will return only the commands that came from Skript.

[#] Fixed the auto update since the previous source to check changed the link. Now it checks in the github.

Just update it with /tuske update plugin if you are 1.7-beta+.