json.sk 2.3

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

  1. Rezz
    Tested Minecraft Versions:
    • 1.8
    • 1.9
    • 1.10
    Contributors:
    RezzedUp, JKGamerxD
    This script is intended for use with the Skript plugin (version 2.2)
    [​IMG]
    [​IMG]
    [​IMG]
    [​IMG] __ [​IMG]

    [​IMG]
    Usage:

    If you don't know how to use Skript 2.2's functions, please view this tutorial.
    Make sure this script loads before all other scripts in order to access its functions!

    • json()
      • json("<recipient>", "<json text in json.sk notation>")
      • Sends a json formatted message to the recipient (accepts @a)
      • Alternative:
        • json("<recipient>", "<text in json.sk-notation>", <OPTIONAL: color codes boolean>)
        • By default, color codes will be converted. If the color codes boolean argument is set to false, json.sk won't convert color codes.
    • jsonFormat()
      • jsonFormat("<text in json.sk notation>")
      • Returns a /tellraw formatted json from the input json.sk notation text.
    • jsonColor()
      • jsonColor("<text>")
      • This function is used by the other json functions to reformat the color codes within the message.
    • jsonSanitize()
      • jsonSanitize("<text>")
      • Returns json-safe text (cancels out all quotation marks)
    • removeColor()
      • removeColor("<text>")
      • Returns text with all & color codes removed.
      • Note: this function will not remove color codes that are already converted (not in &# format anymore).

    [​IMG]

    All possible effect tags:

    • ttp:
      • Appends a hoverable tooltip
    • cmd:
      • Appends a clickable command
      • If not slash is included at the start (/), players will chat a message instead.
    • sgt:
      • Appends a clickable suggestion
      • May be any text (including commands)
    • url:
      • Appends a clickable url
      • If no http:// or https:// is included, json.sk will include http:// automatically
    • ins:


    [​IMG]


    Examples:

    Code (Text):
    command /jsontest:
        trigger:
            json("%player%", "&7&oHello, this is a &bsample json&7.||ttp:&bI'm a tooltip for the first cluster.|| There's no tag, so I've started a new cluster.||cmd:/ping||ttp:&6&o&lCLICK&f for /ping")
    #           |_________|  ||___________________________________|  |________________________________________||||_____________________________________________|  |_______|  |_________________________||
    #            recipient   |            Average Text                                Tooltip                  ||                 Average Text                   Run Command           Tooltip          |
    #                        |_________________________________________________________________________________||_______________________________________________________________________________________|
    #                                                       JSON Cluster #1                                                                           JSON Cluster #2
     
    Results:
    [​IMG]
    [​IMG]

    Code (Text):
    command /jsonformattingtest:
        trigger:
            message jsonFormat("I'd love it if this had a hover effect!||ttp:&oOh look, it does!||sgt:/randomcommand")
    Results:
    [​IMG]



    [​IMG]


    Json.sk compared to SkQuery Syntax:

    Example 1:

    SkQuery: (broken on spigot 1.8.3+)
    Code (Text):
    loop all players:
        send json of "Have a lovely day!" tooltip "&cClick here for some cake! <3" suggest "/i lied" to loop-player
    json.sk: (works with Skript 2.2)
    Code (Text):
    json("@a", "Have a lovely day!||ttp:&cClick here for some cake! <3||sgt:/i lied")

    Example 2:
    SkQuery: (broken on spigot 1.8.3+)
    Code (Text):
    send json of "Hello..." then " ;)" tooltip " ;D" to player
    json.sk: (works with Skript 2.2)
    Code (Text):
    json("%player%", "Hello...|| ;)||ttp: ;D")

Recent Updates

  1. Update json output
  2. Update 2.2
  3. Fix for 2.2 fork users.

Recent Reviews

  1. Domango1
    Domango1
    1/5,
    Version: 2.3
    I have 7 Errors help me...
    I have skript version 2.2 and yea .............................
  2. Trench
    Trench
    5/5,
    Version: 2.3
    I can tell there hasn't been a lot of recent reviews but I still think this skript addon is so good! I have been using it for one of my skripts for awhile now and it just makes it perfect!
  3. BenjaMCDK
    BenjaMCDK
    5/5,
    Version: 2.3
    Addon is great and very fast. Not too hard. I have a question, are there any way you can "execute" a function instead of a command? If not can you make it in a future update..
  4. Bulgaria
    Bulgaria
    5/5,
    Version: 2.3
    Its look good! But how I can use it for url link? Can I have an exp for it many thanks!!
  5. loulou55
    loulou55
    5/5,
    Version: 2.3
    Very good skript, but:

    I have 1 error:

    The fuction 'json' was delete or renamed, but is still used in other script(s). These will continue to use the old version of the function until Skript restarts. (report.sk, line 35: json("%player%, "&b%{_counte}%&f : %loop-value%||cmd:/vciew %{report.%{_counte}%}%||ttp:&fCliquez ici pour vous effacer ce report et se téléporter au joueur")')
  6. ShaneBee
    ShaneBee
    5/5,
    Version: 2.3
    *insert heart emoji here* I LOVE this skript, it has been a huge help. I have never understood json formatting, and this has brought a whole new level into my Skripts. Thank you so much for this!
  7. CRAFTBLAST111
    CRAFTBLAST111
    5/5,
    Version: 2.3
    I would like to know if there is a way that only those who have permission can get the message for example that only users with the permission "admin.message" can receive a message
    sorry for my english
  8. Amigos_LP
    Amigos_LP
    3/5,
    Version: 2.3
    I think it's cool that you wrote this API ... but I still wanted to know if you needed some script addon ...
    (Json.sk has 8 errors for me)
    Script version: 2.2

    Lg DrDonald / Spigot Lappen
  9. FunkyDealer
    FunkyDealer
    5/5,
    Version: 2.3
    Hi, wonderful addon but i've a litle problem in 1.12, in deed i must reload my sk with json in it 2 times for they work and json.sk make an error spam in start, can you update him? please :D :D <3

    Error => https://pastebin.com/hr5KDm3s
    This apear after restart or start but don't apear after en /sk reload name
  10. Renderman
    Renderman
    5/5,
    Version: 2.3
    Amazing script and very useful for making hover messages work in my scripts! Thank you!