Issues with packets

Discussion in 'Skript' started by Lony76, Feb 11, 2020.

  1. Skript version: 2.2-dev25
    Minecraft server version: 1.8

    Hello, I have a issue. I want to check packet (when someone open the inventory) but "on packet:" dosen't work. I have Skellett 1.9.8. Here is a part of the code :
    Code (Text):
    on packet:
        event-string is "PacketPlayInClientCommand"
        set {invop.%player%} to now
    I tried too :
    Code (Text):
    on packet receive:
        event-string is "PacketPlayInClientCommand"
        set {invop.%player%} to now
    but dosen't works too.
    Here is the error:
    Can't understand this event: 'on packet'
     
  2. skellett has removed packets, they are only in older version, also what is your setup, your skript version is super outdated, I recommend dev36 for that. you can use thatpacketaddon for packets and I recommend using list variables instead of dot variables
     
    • Like Like x 1
  3. Thanks! I will apply your recommendations!
    -- Edit :
    Can you please send me the link to the download of Skript dev36 ?
    And how to use ThatPacketAddon?
     
    #3 Lony76, Feb 12, 2020
    Last edited: Feb 12, 2020
  4. you just want to get packet name? then this code will help you:
    Code (Text):


    command /allpackettypes [<text>]:
        permission: op.only
        usage: /allpackettypes [filter]
        trigger:
            if text-arg is set:
                message "&2Looping all packettypes that contain &6%text-arg%&2!"
            else:
                message "&2Looping all packettypes!"
            loop all packettypes:
                if text-arg is set:
                    if "%loop-value%" contains text-arg:
                        message "&a%loop-value%"
                else:
                    message "&a%loop-value%"
            message "&2Done!"
     
    https://github.com/SkriptLang/Skript/releases/download/dev36/Skript.jar
     
  5. No, I have the packet name. It's "PacketPlayInClientCommand". But how to do something similar to "on packet:" ?
     
  6. on packet event <packet>:

    this uses ProtocolLib so packet names differ, it won't work with that name.
     
  7. then what's the name of this packet for ProtocolLib?
     
  8. look up my post above, it gives you the tool to find packet names
     
    • Like Like x 1
  9. Thanks! But now do you know how to detect when the player close the inventory please?
     
  10. on inventory close event
     
  11. yeah but it works only for a chest, not a inventory
     
  12. works for me
     
  13. InventoryCloseEvent is called when a player closes any inventory except their own player inventory. I don't use Skript but I imagine it'd be the same.
     
  14. I uploaded the version you recommended me but now my functions dosen't work :

    Code (Text):
    [20:49:20 ERROR]: #!#!
    [20:49:20 ERROR]: #!#! Version Information:
    [20:49:20 ERROR]: #!#! Skript: 2.2-dev36
    [20:49:20 ERROR]: #!#! Bukkit: 1.8-R0.1-SNAPSHOT
    [20:49:20 ERROR]: #!#! Minecraft: 1.8
    [20:49:20 ERROR]: #!#! Java: 1.8.0_212 (OpenJDK 64-Bit Server VM 25.212-b01)
    [20:49:20 ERROR]: #!#! OS: Linux amd64 4.19.0-6-amd64
    [20:49:20 ERROR]: #!#!
    [20:49:20 ERROR]: #!#! Server platform: Spigot
    [20:49:20 ERROR]: #!#!
    [20:49:20 ERROR]: #!#! Current node: function checkCheat(p: player): (haxrekter.sk, line 79)
    [20:49:20 ERROR]: #!#! Current item: null
    [20:49:20 ERROR]: #!#!
    [20:49:20 ERROR]: #!#! Thread: Server thread
    [20:49:20 ERROR]: #!#!
    [20:49:20 ERROR]: #!#! Language: english
    [20:49:20 ERROR]: null
     
  15. make sure to update skript add-ons too and delete outdated ones
     
  16. I deleted every add-ons to see but same issue. - Here is all details :
    Code (Text):
    [17:04:12 ERROR]: #!#!
    [LEFT][COLOR=rgb(44, 44, 44)][17:04:12 ERROR]: #!#! [Skript] Severe Error:
    [17:04:12 ERROR]: #!#! at ch.njol.skript.registrations.Classes.checkAllowClassInfoInteraction(Classes.java:241)
    [17:04:12 ERROR]: #!#! at ch.njol.skript.registrations.Classes.getClassInfoFromUserInput(Classes.java:336)
    [17:04:12 ERROR]: #!#! at ch.njol.skript.lang.function.Functions.loadSignature(Functions.java:187)
    [17:04:12 ERROR]: #!#! at ch.njol.skript.ScriptLoader.loadStructure(ScriptLoader.java:861)
    [17:04:12 ERROR]: #!#! at ch.njol.skript.ScriptLoader.loadStructure(ScriptLoader.java:823)
    [17:04:12 ERROR]: #!#! at ch.njol.skript.ScriptLoader.loadStructure(ScriptLoader.java:805)
    [17:04:12 ERROR]: #!#! at ch.njol.skript.SkriptCommand.onCommand(SkriptCommand.java:180)
    [17:04:12 ERROR]: #!#! at org.bukkit.command.PluginCommand.execute(PluginCommand.java:44)
    [17:04:12 ERROR]: #!#! at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:141)
    [17:04:12 ERROR]: #!#! at org.bukkit.craftbukkit.v1_8_R1.CraftServer.dispatchCommand(CraftServer.java:646)
    [17:04:12 ERROR]: #!#! at net.minecraft.server.v1_8_R1.PlayerConnection.handleCommand(PlayerConnection.java:1115)
    [17:04:12 ERROR]: #!#! at net.minecraft.server.v1_8_R1.PlayerConnection.a(PlayerConnection.java:950)
    [17:04:12 ERROR]: #!#! at net.minecraft.server.v1_8_R1.PacketPlayInChat.a(PacketPlayInChat.java:26)
    [17:04:12 ERROR]: #!#! at net.minecraft.server.v1_8_R1.PacketPlayInChat.a(PacketPlayInChat.java:53)
    [17:04:12 ERROR]: #!#! at net.minecraft.server.v1_8_R1.PacketHandleTask.run(SourceFile:13)
    [17:04:12 ERROR]: #!#! at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
    [17:04:12 ERROR]: #!#! at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    [17:04:12 ERROR]: #!#! at net.minecraft.server.v1_8_R1.MinecraftServer.z(MinecraftServer.java:696)
    [17:04:12 ERROR]: #!#! at net.minecraft.server.v1_8_R1.DedicatedServer.z(DedicatedServer.java:316)
    [17:04:12 ERROR]: #!#! at net.minecraft.server.v1_8_R1.MinecraftServer.y(MinecraftServer.java:634)
    [17:04:12 ERROR]: #!#! at net.minecraft.server.v1_8_R1.MinecraftServer.run(MinecraftServer.java:537)
    [17:04:12 ERROR]: #!#! at java.lang.Thread.run(Thread.java:748)
    [17:04:12 ERROR]: #!#!
    [17:04:12 ERROR]: #!#! Version Information:
    [17:04:12 ERROR]: #!#! Skript: 2.2-dev36
    [17:04:12 ERROR]: #!#! Bukkit: 1.8-R0.1-SNAPSHOT
    [17:04:12 ERROR]: #!#! Minecraft: 1.8
    [17:04:12 ERROR]: #!#! Java: 1.8.0_212 (OpenJDK 64-Bit Server VM 25.212-b01)
    [17:04:12 ERROR]: #!#! OS: Linux amd64 4.19.0-6-amd64
    [17:04:12 ERROR]: #!#!
    [17:04:12 ERROR]: #!#! Server platform: Spigot
    [17:04:12 ERROR]: #!#!
    [17:04:12 ERROR]: #!#! Current node: function checkCheat(p: player): (haxrekter.sk, line 79)
    [17:04:12 ERROR]: #!#! Current item: null
    [17:04:12 ERROR]: #!#!
    [17:04:12 ERROR]: #!#! Thread: Server thread
    [17:04:12 ERROR]: #!#!
    [17:04:12 ERROR]: #!#! Language: english
    [17:04:12 ERROR]: null
    org.bukkit.command.CommandException: Unhandled exception executing command 'sk' in plugin Skript v2.2-dev36
    at org.bukkit.command.PluginCommand.execute(PluginCommand.java:46) ~[server.jar:git-Spigot-c3c767f-33d5de3]
    at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:141) ~[server.jar:git-Spigot-c3c767f-33d5de3]
    at org.bukkit.craftbukkit.v1_8_R1.CraftServer.dispatchCommand(CraftServer.java:646) ~[server.jar:git-Spigot-c3c767f-33d5de3]
    at net.minecraft.server.v1_8_R1.PlayerConnection.handleCommand(PlayerConnection.java:1115) [server.jar:git-Spigot-c3c767f-33d5de3]
    at net.minecraft.server.v1_8_R1.PlayerConnection.a(PlayerConnection.java:950) [server.jar:git-Spigot-c3c767f-33d5de3]
    at net.minecraft.server.v1_8_R1.PacketPlayInChat.a(PacketPlayInChat.java:26) [server.jar:git-Spigot-c3c767f-33d5de3]
    at net.minecraft.server.v1_8_R1.PacketPlayInChat.a(PacketPlayInChat.java:53) [server.jar:git-Spigot-c3c767f-33d5de3]
    at net.minecraft.server.v1_8_R1.PacketHandleTask.run(SourceFile:13) [server.jar:git-Spigot-c3c767f-33d5de3]
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [?:1.8.0_212]
    at java.util.concurrent.FutureTask.run(FutureTask.java:266) [?:1.8.0_212]
    at net.minecraft.server.v1_8_R1.MinecraftServer.z(MinecraftServer.java:696) [server.jar:git-Spigot-c3c767f-33d5de3]
    at net.minecraft.server.v1_8_R1.DedicatedServer.z(DedicatedServer.java:316) [server.jar:git-Spigot-c3c767f-33d5de3]
    at net.minecraft.server.v1_8_R1.MinecraftServer.y(MinecraftServer.java:634) [server.jar:git-Spigot-c3c767f-33d5de3]
    at net.minecraft.server.v1_8_R1.MinecraftServer.run(MinecraftServer.java:537) [server.jar:git-Spigot-c3c767f-33d5de3]
    at java.lang.Thread.run(Thread.java:748) [?:1.8.0_212]
    Caused by: java.lang.NoClassDefFoundError: Could not initialize class ch.njol.skript.util.chat.ChatMessages
    at ch.njol.skript.Skript.exception(Skript.java:1440) ~[?:?]
    at ch.njol.skript.Skript.exception(Skript.java:1277) ~[?:?]
    at ch.njol.skript.ScriptLoader.loadStructure(ScriptLoader.java:876) ~[?:?]
    at ch.njol.skript.ScriptLoader.loadStructure(ScriptLoader.java:823) ~[?:?]
    at ch.njol.skript.ScriptLoader.loadStructure(ScriptLoader.java:805) ~[?:?]
    at ch.njol.skript.SkriptCommand.onCommand(SkriptCommand.java:180) ~[?:?]
    at org.bukkit.command.PluginCommand.execute(PluginCommand.java:44) ~[server.jar:git-Spigot-c3c767f-33d5de3]
    ... 14 more
    [/COLOR][/LEFT]
     
  17. then update your server version, it seems to be extremely outdated server. update it to at least 1.8.8 if you absolutely need it to be within 1.8 range.
     
  18. Ok I'll try. Thanks. I'll give you news after
    - Edit:
    Nice, it works nice! I'll try to restore all add-ons
    - Edit 2:
    Now, when I'm calling a function, it says "function dosen't exists"
     
    #18 Lony76, Feb 14, 2020
    Last edited: Feb 14, 2020