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.

API json.sk 2.3

A fix for SkQuery's JSON messages for 1.8.3+ (and 1.9.x - 1.11.x) servers.

  1. Rezz

    Resource Staff Addon Developer

    Joined:
    Jan 24, 2017
    Messages:
    80
    Likes Received:
    35
    Medals:
  2. ShaneBee

    Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,007
    Likes Received:
    138
    i got 7 error:


    Code (Skript):
    1. ERROR 'json({_to}, {_msg})' is not a boolean (yes/no) (json.sk, line 335: json({_to}, {_msg})')
    2. ERROR 'jsonBroadcast(msg: text, color: boolean = true)' is not a text (json.sk, line 315: function jsonBroadcast(msg: text, color: boolean = true):')
    3. ERROR 'json(to: text, msg: text, color: boolean = true)' is not a text (json.sk, line 302: function json(to: text, msg: text, color: boolean = true):')
    4. ERROR 'jsonFormat(msg: text, color: boolean = true) :: text' is not a text (json.sk, line 205: function jsonFormat(msg: text, color: boolean = true) :: text:')
    5. ERROR 'jsonSanitize(msg: text) :: text' is not a text (json.sk, line 182: function jsonSanitize(msg: text) :: text:')
    6. ERROR 'jsonColorize(msg: text, default-color: text = "&r") :: text' is not a text (json.sk, line 124: function jsonColorize(msg: text, default-color: text = "&r") :: text:')
    7. ERROR 'removeColor(msg: text) :: text' is not a text (json.sk, line 91: function removeColor(msg: text) :: text:')
     
  3. ShaneBee

    Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,007
    Likes Received:
    138
    And what is the output of /version skript?

    If it's anything lower than 2.2, consider updating. :emoji_wink:
     
    #3 ShaneBee, Feb 3, 2017
    Last edited by a moderator: Feb 3, 2017
  4. ShaneBee

    Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,007
    Likes Received:
    138
    i forget to check my skript version.
    Thx, i will update my skript.
     
  5. ShaneBee

    Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,007
    Likes Received:
    138
    Is there a way to have multiple lines on a tooltip?
     
  6. ShaneBee

    Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,007
    Likes Received:
    138
    Yes.
    Use %newline%
     
    • Agree Agree x 1
  7. ShaneBee

    Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,007
    Likes Received:
    138
    upload_2017-2-9_18-10-46.png

    json("@a","Test Text||ttp:§6Line 1 %newline% §bLine 2")

    dosen't seem to work
     
  8. ShaneBee

    Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,007
    Likes Received:
    138
    Try using \n, and if it doesn't work try putting the slash twice.
     
  9. ShaneBee

    Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,007
    Likes Received:
    138
    upload_2017-2-10_22-1-59.png
    upload_2017-2-10_22-2-22.png


    json("@a","Test Text||ttp:§6Line 1\ \n §bLine 2")
    json("@a","Test Text||ttp:§6Line 1\n §bLine 2")
     
  10. ShaneBee

    Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,007
    Likes Received:
    138
    %nl% works for me:
    json("@a","Test Text||ttp:§6Line 1%nl% §bLine 2")
     
    • Agree Agree x 1
  11. ShaneBee

    Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,007
    Likes Received:
    138
    Thanks! but this still happens:
    upload_2017-2-10_23-11-3.png
    json("@a","Test Text||ttp:§6Line 1%nl%§bLine 2")
     
  12. ShaneBee

    Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,007
    Likes Received:
    138
    I'm unable to reproduce that behavior.

    [​IMG]

    Code (Skript):
    1. on chat:
    2.     cancel event
    3.     json("@a", "%player%: &6%message%||ttp:&eFirst line&r%nl%&7Second line")
     
    • Agree Agree x 1
  13. ShaneBee

    Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,007
    Likes Received:
    138
    upload_2017-2-11_0-29-23.png

    I have managed to find the cause of this.

    It seems that using Umbaska causes this problem, I'm using 3.3 and removing it seems to solve the issue.
     
  14. ShaneBee

    Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,007
    Likes Received:
    138
    @Rasor1911 it could be because the Core module is overriding the new line expression of skQuery, try using "system line" instead.
     
  15. ShaneBee

    Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,007
    Likes Received:
    138
    Still getting the same issue with %system line%
     
  16. ShaneBee

    Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,007
    Likes Received:
    138
    How can I set the load priority of this script?
     
  17. ShaneBee

    Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,007
    Likes Received:
    138
    Just putting a prefix on its name, changing the name of it to "+json.sk" or "1_json.sk" will make Skript load this script before others.
     
  18. ShaneBee

    Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,007
    Likes Received:
    138
    Skript loads scripts in an A-Z order. Set it to a.sk or something like that. Have file sorting set by name A-Z and the top script will be loaded first. Remember: Skript won't load scripts that start with -, but you can use characters like that to load it first (I think "." puts it at the top?)

    EDIT: I probably should of refresh before posting lol.
     
  19. ShaneBee

    Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,007
    Likes Received:
    138
    Thanks, I would suggest mentioning that into the plugin download page and also on spigot.
     
  20. ShaneBee

    Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,007
    Likes Received:
    138
    So, instead of doing:
    and:
    I recommend creating a folder and moving json.sk into it. Folders are also loaded in alphabetical order, so I always put json.sk inside a directory called "__lib".

    Periods in front of filenames will hide the file on Linux hosts, though. :emoji_stuck_out_tongue:
     
Loading...