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!

  2. LOOKING FOR A VERSION OF SKRIPT??:

    You can always check our our Wiki for downloads and any other information about Skript!

Dismiss Notice
This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Solved Weird error in console

Discussion in 'Skript' started by zDan_YT, Nov 25, 2018.

  1. z

    zDan_YT Member

    Joined:
    Mar 6, 2017
    Messages:
    7
    Likes Received:
    0
    Hey there. I made a skript where you can type [money] and [exp] to display the exp and money you have in chat. The EXP is EXACTLY THE SAME as the money, but money doesnt work and shows this.

    You can see version, etc. in the stacktrace, but I'm using PaperSpigot.

    As I said, the [money] doesn't give any errors. Just that thing in console, and it doesnt work. Please help.


    Code:
    Code (Skript):
    1. on chat:
    2.     if message contains "[money]":
    3.         if player has permission "crypt.balitem":
    4.             cancel event
    5.             set {_n} to balance of player
    6.             replace all "[money]" in the chat message with "§a§l%{_n}% Money§r"
    7.             send "%player's displayname% &8»&r %message%" to all players
    8.         else:
    9.             cancel event
    10.             send "&e&l> &7You do not have permission to [money]! Unlock access at &ebuy.???.net&7."
    11.  
    12.     if message contains "[exp]":
    13.         if player has permission "crypt.expitem":
    14.             cancel event
    15.             replace all "[exp]" with "&d&l%xp of player% XP&r" in message
    16.             send "%player's displayname% &8»&r %message%" to all players
    17.         else:
    18.             cancel event
    19.             send "&e&l> &7You do not have permission to [exp]! Unlock access at &ebuy.???.net&7."

    Code (Skript):
    1. > [21:24:36 ERROR]: #!#!
    2. > [21:24:36 ERROR]: #!#! [Skript] Severe Error:
    3. > [21:24:36 ERROR]: #!#!
    4. > [21:24:36 ERROR]: #!#! If you're developing an add-on for Skript this likely means that you have done something wrong.
    5. > [21:24:36 ERROR]: #!#! If you're a server admin however please go to http://dev.bukkit.org/server-mods/skript/tickets/
    6. > [21:24:36 ERROR]: #!#! and check whether this error has already been reported.
    7. > [21:24:36 ERROR]: #!#! If not please create a new ticket with a meaningful title, copy & paste this whole error into it,
    8. > [21:24:36 ERROR]: #!#! and describe what you did before it happened and/or what you think caused the error.
    9. > [21:24:36 ERROR]: #!#! If you think that it's a trigger that's causing the error please post the trigger as well.
    10. > [21:24:36 ERROR]: #!#! By following this guide fixing the error should be easy and done fast.
    11. > [21:24:36 ERROR]: #!#!
    12. > [21:24:36 ERROR]: #!#! Stack trace:
    13. > [21:24:36 ERROR]: #!#! java.lang.IllegalArgumentException: Illegal group reference
    14. > [21:24:36 ERROR]: #!#! at java.util.regex.Matcher.appendReplacement(Matcher.java:857)
    15. > [21:24:36 ERROR]: #!#! at java.util.regex.Matcher.replaceAll(Matcher.java:955)
    16. > [21:24:36 ERROR]: #!#! at java.lang.String.replaceAll(String.java:2223)
    17. > [21:24:36 ERROR]: #!#! at ch.njol.util.StringUtils.replace(StringUtils.java:406)
    18. > [21:24:36 ERROR]: #!#! at ch.njol.skript.effects.EffReplace.execute(EffReplace.java:85)
    19. > [21:24:36 ERROR]: #!#! at ch.njol.skript.lang.Effect.run(Effect.java:54)
    20. > [21:24:36 ERROR]: #!#! at ch.njol.skript.lang.TriggerItem.walk(TriggerItem.java:63)
    21. > [21:24:36 ERROR]: #!#! at ch.njol.skript.lang.TriggerItem.walk(TriggerItem.java:91)
    22. > [21:24:36 ERROR]: #!#! at ch.njol.skript.lang.Trigger.execute(Trigger.java:53)
    23. > [21:24:36 ERROR]: #!#! at ch.njol.skript.events.EvtChat$1.execute(EvtChat.java:68)
    24. > [21:24:36 ERROR]: #!#! at ch.njol.skript.events.EvtChat$1$1.call(EvtChat.java:87)
    25. > [21:24:36 ERROR]: #!#! at ch.njol.skript.events.EvtChat$1$1.call(EvtChat.java:1)
    26. > [21:24:36 ERROR]: #!#! at org.bukkit.craftbukkit.v1_8_R3.scheduler.CraftFuture.run(CraftFuture.java:89)
    27. > [21:24:36 ERROR]: #!#! at org.bukkit.craftbukkit.v1_8_R3.scheduler.CraftScheduler.mainThreadHeartbeat(CraftScheduler.java:352)
    28. > [21:24:36 ERROR]: #!#! at net.minecraft.server.v1_8_R3.MinecraftServer.B(MinecraftServer.java:783)
    29. > [21:24:36 ERROR]: #!#! at net.minecraft.server.v1_8_R3.DedicatedServer.B(DedicatedServer.java:378)
    30. > [21:24:36 ERROR]: #!#! at net.minecraft.server.v1_8_R3.MinecraftServer.A(MinecraftServer.java:713)
    31. > [21:24:36 ERROR]: #!#! at net.minecraft.server.v1_8_R3.MinecraftServer.run(MinecraftServer.java:616)
    32. > [21:24:36 ERROR]: #!#! at java.lang.Thread.run(Thread.java:748)
    33. > [21:24:36 ERROR]: #!#!
    34. > [21:24:36 ERROR]: #!#! Version Information:
    35. > [21:24:36 ERROR]: #!#! Skript: 2.2-Fixes-V8
    36. > [21:24:36 ERROR]: #!#! Bukkit: 1.8.8-R0.1-SNAPSHOT
    37. > [21:24:36 ERROR]: #!#! Minecraft: 1.8.8
    38. > [21:24:36 ERROR]: #!#! Java: 1.8.0_171 (OpenJDK 64-Bit Server VM 25.171-b11)
    39. > [21:24:36 ERROR]: #!#! OS: Linux amd64 4.4.0-116-generic
    40. > [21:24:36 ERROR]: #!#!
    41. > [21:24:36 ERROR]: #!#! Running CraftBukkit: false
    42. > [21:24:36 ERROR]: #!#!
    43. > [21:24:36 ERROR]: #!#! Current node: null
    44. > [21:24:36 ERROR]: #!#! Current item: replace "[money]" in the chat message with "§a§l$%{_n}(as java.lang.Object)%§r"
    45. > [21:24:36 ERROR]: #!#!
    46. > [21:24:36 ERROR]: #!#! Thread: Server thread
    47. > [21:24:36 ERROR]: #!#!
    48. > [21:24:36 ERROR]: #!#! End of Error.
    49. > [21:24:36 ERROR]: #!#!


     
  2. Best Answer:
    Post #7 by Noblesuntzu, Dec 12, 2018 at 2:33 AM
  3. L

    Joined:
    Jan 26, 2017
    Messages:
    317
    Likes Received:
    12
    try:

    Code (Skript):
    1. on chat:
    2.     if message contains "[money]":
    3.         if player has permission "crypt.balitem":
    4.             cancel event
    5.             set {_n} to balance of player
    6.             replace "[money]" with "§a§l%{_n}% Money§r" in message
    7.             send "%player's displayname% &8»&r %message%" to all players
    8.         else:
    9.             cancel event
    10.             send "&e&l> &7You do not have permission to [money]! Unlock access at &ebuy.???.net&7."
    11.  
    12.     if message contains "[exp]":
    13.         if player has permission "crypt.expitem":
    14.             cancel event
    15.             replace "[exp]" with "&d&l%xp of player% XP&r" in message
    16.             send "%player's displayname% &8»&r %message%" to all players
    17.         else:
    18.             cancel event
    19.             send "&e&l> &7You do not have permission to [exp]! Unlock access at &ebuy.???.net&7."
     
  4. Reindeerie

    Reindeerie Member

    Joined:
    Apr 15, 2018
    Messages:
    14
    Likes Received:
    0

    Don't spoonfeed. Although the code should work. The console is probably confused about the § symbols, Skript uses &s instead, for clarity, ease of typing, and to work around the fact that RegularExpression replacement uses section signs as group symbols.

    Also, currently your skript is hardwired for only one message format. I'd recommend using this instead:
    Code (Skript):
    1.  
    2. set {_newMessage} to message
    3. replace every "[money]" with "&a&l%{_n}% Money&r" in {_newMessage}
    4. set message to {_newMessage}
    5.  
    This instead of the cancel event and manually sending a new message to all players is much more dynamic and should work fine. (Haven't tested it, though.) Lego Freak's code would work but he forgot to change the symbols in the first money replace.
     
    #3 Reindeerie, Nov 27, 2018
    Last edited: Nov 27, 2018
  5. z

    zDan_YT Member

    Joined:
    Mar 6, 2017
    Messages:
    7
    Likes Received:
    0
    Thank you. The code you've shown is indeed making it working better, but [money] SURPRISINGLY doesn't still work. :emoji_disappointed_relieved:

    Code (Skript):
    1.  
    2. on chat:
    3.     if message contains "[money]":
    4.         if player has permission "crypt.balitem":
    5.             set {_newMessage} to message
    6.             set {_n} to player's balance
    7.             replace every "[money]" with "&a&l$%{_n}%&r" in {_newMessage}
    8.             set message to {_newMessage}
    9.         else:
    10.             cancel event
    11.             send "&e&l> &7You do not have permission to [money]! Unlock access at &ebuy.cryptmc.net&7."
    12.  
    --- Double Post Merged, Nov 30, 2018, Original Post Date: Nov 30, 2018 ---
    I just found out that my current skript version is pretty bad and unstable, but I spent months trying to find a stable 1.8.9 Skript plugin.

    Do you have a good Skript 1.8.9 plugin that works well?
     
  6. Reindeerie

    Reindeerie Member

    Joined:
    Apr 15, 2018
    Messages:
    14
    Likes Received:
    0
    List all of your plugins. It's possible that your version of Skript doesn't support balance, or you don't have Vault.
     
  7. z

    zDan_YT Member

    Joined:
    Mar 6, 2017
    Messages:
    7
    Likes Received:
    0
    It supports balance because I have another skript that gives money without /eco give, and I have vault but here you go:

    Plugins (49): PluginConstructorAPI, PlaceholderAPI, SmoothKnockback, PlugMan, AutoLapiz, MobStacker, VoxelSniper, ViaVersion, StaffPlus, CoreProtect, WorldEdit, DisplayItem, HealthBar, Skript, ClearLag, SkQuery, Multiverse-Core, ProtocolLib, Skellett, PhantomAntiDupe, eZProtector, PixelPrinter, ObsidianBreaker, MundoSK, WildSkript, PermissionsEx, skUtilities, skript-mirror, Vault, NoMobSuffocation, Lores, CrazyCrates, UltimateBrag, SharpSK, HolographicDisplays, TuSKe, skRayFall, PlayerVaults, Essentials, WorldChangeScreenRemover, BuycraftX, CrazyAuctions, EssentialsChat, EssentialsSpawn, Factions, FactionsTop, FBasics, KoTH, SilkSpawners

    I'm running Skript v2.2 Fixes V8, I couldn't find the Fixes V8B [that one is flawlessly working]. Do you have a link for the Fixes V8B version?
     
  8. Noblesuntzu

    Noblesuntzu Well-Known Member

    Joined:
    Feb 18, 2017
    Messages:
    60
    Likes Received:
    1
    I could be wrong but I believe Fixes V8b is no longer available because basically everyone has stopped using 1.8 for Skript. I would definitely recommend gettings the official skript 2.3-beta4 and use ViaVersion with the base set to 1.8.8 because it is incredibly difficult to find any support for 1.8 nowadays.
     
  9. z

    zDan_YT Member

    Joined:
    Mar 6, 2017
    Messages:
    7
    Likes Received:
    0
    Thank you,
    This is the best solution.
     
    • Friendly Friendly x 1
Loading...