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 [Abandoned] json.sk 2.3

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

  1. ShaneBee

    Moderator Resource Staff Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,181
    Likes Received:
    220
    Hi, you can add them:
    "&b[Diamond Sword]||itm:<id>stone<name>&bDiamond Sword<lore>line1-line2"

    "&a[Taking Inventory]||ach:achievement.openInventory"

    "&7[Distance Walked]||stt:stat.walkOneCm"

    "&3Blueyescat||ent:<name>&3Blueyescat<type>A Cat<id>&dmeow(uuid)"
    http://www.minecraftforum.net/forums/....#ListofhoverEvents
    :emoji_slight_smile:
     
    #21 ShaneBee, Mar 2, 2017
    Last edited by a moderator: Mar 2, 2017
  2. ShaneBee

    Moderator Resource Staff Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,181
    Likes Received:
    220
    Didn't even know Skript loaded scripts in folders.
     
  3. ShaneBee

    Moderator Resource Staff Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,181
    Likes Received:
    220
    It does.
    Code (Text):
    1. plugins/Skript/scripts/__lib/json.sk
    Works beautifully. :emoji_grinning:

    You can even reload all scripts in specific folders: /sk reload __lib/
     
  4. ShaneBee

    Moderator Resource Staff Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,181
    Likes Received:
    220
    Oh actually, I've used it before lol. Old server with @maeyrl and @Gatt had this. I completely forgot about it :emoji_astonished:. It's such a useful feature.
     
    • Like Like x 1
    • Agree Agree x 1
  5. ShaneBee

    Moderator Resource Staff Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,181
    Likes Received:
    220
    I got this error when I tried using this on 1.11.2 server using bensku's fork of the Skript. What could cause this?
    Code (Skript):
    1.  
    2. 03.03 14:35:45 [Server] ERROR #!#!
    3. 03.03 14:35:45 [Server] ERROR #!#! [Skript] Severe Error:
    4. 03.03 14:35:45 [Server] ERROR #!#! Exception occurred in Skript's main command
    5. 03.03 14:35:45 [Server] ERROR #!#! Used command: /sk reload json
    6. 03.03 14:35:45 [Server] ERROR #!#!
    7. 03.03 14:35:45 [Server] ERROR #!#! If you're developing an add-on for Skript this likely means that you have done something wrong.
    8. 03.03 14:35:45 [Server] ERROR #!#! If you're a server admin however please go to https://github.com/bensku/Skript/issues/
    9. 03.03 14:35:45 [Server] ERROR #!#! and check whether this error has already been reported.
    10. 03.03 14:35:45 [Server] ERROR #!#! If not please create a new ticket with a meaningful title, copy & paste this whole error into it (or use paste service),
    11. 03.03 14:35:45 [Server] ERROR #!#! and describe what you did before it happened and/or what you think caused the error.
    12. 03.03 14:35:45 [Server] ERROR #!#! If you think that it's a trigger that's causing the error please post the trigger as well.
    13. 03.03 14:35:45 [Server] ERROR #!#! By following this guide fixing the error should be easy and done fast.
    14. 03.03 14:35:45 [Server] ERROR #!#!
    15. 03.03 14:35:45 [Server] ERROR #!#! Stack trace:
    16. 03.03 14:35:45 [Server] ERROR #!#! java.lang.NullPointerException
    17. 03.03 14:35:45 [Server] ERROR #!#!     at ch.njol.skript.lang.function.Functions.clearFunctions(Functions.java:264)
    18. 03.03 14:35:45 [Server] ERROR #!#!     at ch.njol.skript.SkriptEventHandler.removeTriggers(SkriptEventHandler.java:255)
    19. 03.03 14:35:45 [Server] ERROR #!#!     at ch.njol.skript.ScriptLoader.unloadScript_(ScriptLoader.java:713)
    20. 03.03 14:35:45 [Server] ERROR #!#!     at ch.njol.skript.ScriptLoader.unloadScript(ScriptLoader.java:706)
    21. 03.03 14:35:45 [Server] ERROR #!#!     at ch.njol.skript.SkriptCommand.onCommand(SkriptCommand.java:165)
    22. 03.03 14:35:45 [Server] ERROR #!#!     at org.bukkit.command.PluginCommand.execute(PluginCommand.java:44)
    23. 03.03 14:35:45 [Server] ERROR #!#!     at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:141)
    24. 03.03 14:35:45 [Server] ERROR #!#!     at org.bukkit.craftbukkit.v1_11_R1.CraftServer.dispatchCommand(CraftServer.java:650)
    25. 03.03 14:35:45 [Server] ERROR #!#!     at net.minecraft.server.v1_11_R1.PlayerConnection.handleCommand(PlayerConnection.java:1344)
    26. 03.03 14:35:45 [Server] ERROR #!#!     at net.minecraft.server.v1_11_R1.PlayerConnection.a(PlayerConnection.java:1179)
    27. 03.03 14:35:45 [Server] ERROR #!#!     at net.minecraft.server.v1_11_R1.PacketPlayInChat.a(PacketPlayInChat.java:45)
    28. 03.03 14:35:45 [Server] ERROR #!#!     at net.minecraft.server.v1_11_R1.PacketPlayInChat.a(PacketPlayInChat.java:1)
    29. 03.03 14:35:45 [Server] ERROR #!#!     at net.minecraft.server.v1_11_R1.PlayerConnectionUtils$1.run(SourceFile:13)
    30. 03.03 14:35:45 [Server] ERROR #!#!     at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
    31. 03.03 14:35:45 [Server] ERROR #!#!     at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    32. 03.03 14:35:45 [Server] ERROR #!#!     at net.minecraft.server.v1_11_R1.SystemUtils.a(SourceFile:46)
    33. 03.03 14:35:45 [Server] ERROR #!#!     at net.minecraft.server.v1_11_R1.MinecraftServer.D(MinecraftServer.java:739)
    34. 03.03 14:35:45 [Server] ERROR #!#!     at net.minecraft.server.v1_11_R1.DedicatedServer.D(DedicatedServer.java:399)
    35. 03.03 14:35:45 [Server] ERROR #!#!     at net.minecraft.server.v1_11_R1.MinecraftServer.C(MinecraftServer.java:675)
    36. 03.03 14:35:45 [Server] ERROR #!#!     at net.minecraft.server.v1_11_R1.MinecraftServer.run(MinecraftServer.java:574)
    37. 03.03 14:35:45 [Server] ERROR #!#!     at java.lang.Thread.run(Thread.java:745)
    38. 03.03 14:35:45 [Server] ERROR #!#!
    39. 03.03 14:35:45 [Server] ERROR #!#! Version Information:
    40. 03.03 14:35:45 [Server] ERROR #!#!   Skript: 2.2-dev24b
    41. 03.03 14:35:45 [Server] ERROR #!#!   Bukkit: 1.11.2-R0.1-SNAPSHOT
    42. 03.03 14:35:45 [Server] ERROR #!#!   Minecraft: 1.11.2
    43. 03.03 14:35:45 [Server] ERROR #!#!   Java: 1.8.0_121 (Java HotSpot(TM) 64-Bit Server VM 25.121-b13)
    44. 03.03 14:35:45 [Server] ERROR #!#!   OS: Linux amd64 4.8.13-xxxx-grs-ipv6-64
    45. 03.03 14:35:45 [Server] ERROR #!#!
    46. 03.03 14:35:45 [Server] ERROR #!#! Running CraftBukkit: false
    47. 03.03 14:35:45 [Server] ERROR #!#!
    48. 03.03 14:35:45 [Server] ERROR #!#! Current node: null
    49. 03.03 14:35:45 [Server] ERROR #!#! Current item: null
    50. 03.03 14:35:45 [Server] ERROR #!#!
    51. 03.03 14:35:45 [Server] ERROR #!#! Thread: Server thread
    52. 03.03 14:35:45 [Server] ERROR #!#!
    53. 03.03 14:35:45 [Server] ERROR #!#! End of Error.
    54. 03.03 14:35:45 [Server] ERROR #!#!
     
  6. ShaneBee

    Moderator Resource Staff Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,181
    Likes Received:
    220
    Don't use dev24 - it's incredibly broken. Downgrade to dev23.
     
  7. ShaneBee

    Moderator Resource Staff Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,181
    Likes Received:
    220
    Where did you hear that? The dev24b is stable and I didn't have any issues with it, you might be talking about the dev24.
     
  8. ShaneBee

    Moderator Resource Staff Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,181
    Likes Received:
    220
    Clearly it isn't entirely fixed. See @Juksu's post.
     
  9. ShaneBee

    Moderator Resource Staff Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,181
    Likes Received:
    220
    I'm using your script with the dev24b and O didn't have any issues so...
     
  10. ShaneBee

    Moderator Resource Staff Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,181
    Likes Received:
    220
    Trying to use json.sk, and I get this error randomly. No idea why it's happening at all.

    To reproduce it, what I do is:
    1. Reload `!json.sk` (/sk reload !json.sk) No Errors
    2. Reload skript that uses json.sk (/sk reload chatbot) No Errors
    3. None of the json.sk stuff works
    4. Reload `!json.sk` (/sk reload !json.sk) Errors
    [​IMG]
     
  11. ShaneBee

    Moderator Resource Staff Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,181
    Likes Received:
    220
    Why do you reload json.sk? It only has to be loaded before every script that uses it on the start, then you don't have to [re]load it anymore unless you did a modification.
     
  12. ShaneBee

    Moderator Resource Staff Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,181
    Likes Received:
    220
    That isn't a real error, so to say. Skript is just warning you that you're using the json.sk's functions in other scripts. It's also notifying you that Skript (currently) is incapable of updating json.sk's functions in those other scripts, so they'll use old versions of the functions until they're also reloaded.
     
  13. ShaneBee

    Moderator Resource Staff Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,181
    Likes Received:
    220
    I found out my error. But I don't know how to fix it.

    The players recieving the json message are in a list variable, {helpops::*} to be exact. The players are added to the variable, not "set {helpops::%player%} to true" style.
    Is there a way around this? Would I `loop {helpops::*}` then send the json to loop-value?
     
  14. ShaneBee

    Moderator Resource Staff Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,181
    Likes Received:
    220
    The latest bensku release did something that breaks this... obviously they've been adding json stuff built-in making this kind of irrelevant but json.sk has insertion, plus i'd have to rewrite lots of json() calls in all my scripts if i wanted to use it. I'd look into fixing the function myself but I figured I'd ask here first. Any plans on updating it?
     
    • Agree Agree x 3
  15. ShaneBee

    Moderator Resource Staff Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,181
    Likes Received:
    220
    What's broken?
     
  16. ShaneBee

    Moderator Resource Staff Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,181
    Likes Received:
    220
  17. ShaneBee

    Moderator Resource Staff Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,181
    Likes Received:
    220
    • Like Like x 1
  18. ShaneBee

    Moderator Resource Staff Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,181
    Likes Received:
    220
  19. IB0yTV

    IB0yTV Member

    Joined:
    Aug 14, 2017
    Messages:
    1
    Likes Received:
    0
    For the new update, added on json.sk the possibility of functions. Example :
    json("%player%" , "Hello, its just json message||fct: Hellojson(player)")
    |_________| |___________________________| |_____________________|
    Recipient Average Text Run Function

    function Hellojson (p: player):
    send "Your &b%{_p}% &rand me &bJson !" to {_p}
     
  20. Rezz

    Addon Developer

    Joined:
    Jan 24, 2017
    Messages:
    80
    Likes Received:
    37
    Medals:
    That's not how functions nor json messages work. If you want a player to execute something, it must be a command.
     
    • Agree Agree x 1

Share This Page

Loading...