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.

Addon skript-json 1.1.0

Seamless JSON integration for Skript

  1. btk5h

    Addon Developer

    Joined:
    Jan 25, 2017
    Messages:
    154
    Likes Received:
    159
    btk5h submitted a new resource:

    skript-json - Seamless JSON integration for Skript

    Read more about this resource...
     
  2. ShaneBee

    Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,183
    Likes Received:
    234
    Here's a challenge: write a json parser with all the functionality of this addon in skript. It can be done. :emoji_smile:
     
  3. ShaneBee

    Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,183
    Likes Received:
    234
    Jsonsk is better. :emoji_grinning:
     
  4. ShaneBee

    Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,183
    Likes Received:
    234
    ???

    This addon is for parsing json, not sending chat messages.
     
  5. ShaneBee

    Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,183
    Likes Received:
    234
    Oh lol. I didn't read the page. x)
     
  6. ShaneBee

    Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,183
    Likes Received:
    234
    How can you know that json.sk is beter without even making a competisant?
     
  7. ShaneBee

    Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,183
    Likes Received:
    234
    Challenge accepted.
     
  8. ShaneBee

    Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,183
    Likes Received:
    234
    btk5h updated skript-json with a new update entry:

    skript-json 1.1.0

    Read the rest of this update entry...
     
  9. CookieST

    CookieST Member

    Joined:
    Feb 10, 2017
    Messages:
    4
    Likes Received:
    0
    I think you should methods for formatting chat with json. The addon is called skript-json so you should go all in with this :emoji_slight_smile:
     
  10. BrettPlayMC

    Supporter

    Joined:
    Jan 26, 2017
    Messages:
    715
    Likes Received:
    53
    If there's an addon for it then why should he add it into this one?
     
  11. KingAlterIV

    KingAlterIV Active Member

    Joined:
    Jan 26, 2017
    Messages:
    98
    Likes Received:
    16
    I think you didn't understand the point of this addon.This addon isn't for minecraft's json chat. Even if the name says json, its not for minecraft's json chat. This addon is for api that uses json. There's also no point in adding in this when there are plenty of other addons that has json already. If you want minecraft json, then use json.sk (dev25 and below) or Bensku's built in json messages (dev26 and above).
    [​IMG]
     
  12. Pikachu

    Supporter Addon Developer

    Joined:
    Jan 25, 2017
    Messages:
    870
    Likes Received:
    139
    Medals:
    What you are calling json is actually called chat component
     
  13. CookieST

    CookieST Member

    Joined:
    Feb 10, 2017
    Messages:
    4
    Likes Received:
    0
    Never knew it was already built into Skript - thanks!
     
  14. ayoungcoder

    ayoungcoder Member

    Joined:
    Aug 23, 2017
    Messages:
    17
    Likes Received:
    1
    ```
    set {_json::mapdata::bluespawn1} to sharpsk worldguard point 1 of region "hut%loop-value-1%blue" in world "%{loc.%loop-value-1%.red}'s world%"
    set {_jsonastext} to "%the serialized json form of {_json::*}%"
    set file contents of "json/%loop-value%.json" to "%{_jsonastext}%"

    ```
    How do i make this be stored as a string in a json file instead of a json object?

    ```
    • "mainspawn":"x: -39.67, y: 52, z: -0.17" is what i want

    • "bluenexuses:1":{
      • "world":"cherrylandmc",
      • "__javaclass__":"org.bukkit.Location",
      • "x":41.0,
      • "y":27.0,
      • "z":107.0,
      • "pitch":0.0,
      • "yaw":0.0
      },
    • is what i get
      ```
     
  15. btk5h

    Addon Developer

    Joined:
    Jan 25, 2017
    Messages:
    154
    Likes Received:
    159
    Locations (and some other classes) are serialized in a special way so that they can be restored later by skript-json. If you're using another plugin that needs locations in a different format, you will need to create the string yourself instead of storing a location.
     
  16. ayoungcoder

    ayoungcoder Member

    Joined:
    Aug 23, 2017
    Messages:
    17
    Likes Received:
    1
    My idea was to have files that users are able to edit by hand but that can also be read from skript. Does skript have a way to turn that location into a string?
     
  17. Snow-Pyon

    Snow-Pyon Well-Known Member

    Joined:
    Jan 25, 2017
    Messages:
    1,235
    Likes Received:
    176
    Medals:
    Just strigfy it.

    Setting:
    Code (Skript):
    1. set {_my-json-var::location::coordinates} to "%event-location%"
    2. set {my-json-var::location::world} to world of event-location
    3. set {_json} to json form of {_my-json-var::*}
    should do the job


    For converting it again you'd do:
    Code (Text):
    1. map json {_json} to {_locations::*}
    2. set {_coordinates::*} to {_locations::location::coordinates} parsed as "x: %number%, y: %number%, z: %number%"
    3. set {_world} to world({_locations::location::world})
    4. set {_location} to location({_coordinates::*}, {_world})
     

Share This Page

Loading...