Solved Weird error in console

  • 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!

  • LOOKING FOR A VERSION OF SKRIPT?

    You can always check out skUnity Downloads for downloads and any other information about Skript!

Status
Not open for further replies.

zDan_YT

New Member
Mar 6, 2017
7
0
0
25
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_language.skript:
on chat:
    if message contains "[money]":
        if player has permission "crypt.balitem":
            cancel event
            set {_n} to balance of player
            replace all "[money]" in the chat message with "§a§l%{_n}% Money§r"
            send "%player's displayname% &8»&r %message%" to all players
        else:
            cancel event
            send "&e&l> &7You do not have permission to [money]! Unlock access at &ebuy.???.net&7."

    if message contains "[exp]":
        if player has permission "crypt.expitem":
            cancel event
            replace all "[exp]" with "&d&l%xp of player% XP&r" in message
            send "%player's displayname% &8»&r %message%" to all players
        else:
            cancel event
            send "&e&l> &7You do not have permission to [exp]! Unlock access at &ebuy.???.net&7."


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

code_language.skript:
on chat:
    if message contains "[money]":
        if player has permission "crypt.balitem":
            cancel event
            set {_n} to balance of player
            replace "[money]" with "§a§l%{_n}% Money§r" in message
            send "%player's displayname% &8»&r %message%" to all players
        else:
            cancel event
            send "&e&l> &7You do not have permission to [money]! Unlock access at &ebuy.???.net&7."
 
    if message contains "[exp]":
        if player has permission "crypt.expitem":
            cancel event
            replace "[exp]" with "&d&l%xp of player% XP&r" in message
            send "%player's displayname% &8»&r %message%" to all players
        else:
            cancel event
            send "&e&l> &7You do not have permission to [exp]! Unlock access at &ebuy.???.net&7."
 
try:

code_language.skript:
on chat:
    if message contains "[money]":
        if player has permission "crypt.balitem":
            cancel event
            set {_n} to balance of player
            replace "[money]" with "&a&l%{_n}% Money&r" in message
            send "%player's displayname% &8»&r %message%" to all players
        else:
            cancel event
            send "&e&l> &7You do not have permission to [money]! Unlock access at &ebuy.???.net&7."
 
    if message contains "[exp]":
        if player has permission "crypt.expitem":
            cancel event
            replace "[exp]" with "&d&l%xp of player% XP&r" in message
            send "%player's displayname% &8»&r %message%" to all players
        else:
            cancel event
            send "&e&l> &7You do not have permission to [exp]! Unlock access at &ebuy.???.net&7."


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_language.skript:
set {_newMessage} to message
replace every "[money]" with "&a&l%{_n}% Money&r" in {_newMessage}
set message to {_newMessage}

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.
 
Last edited:
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_language.skript:
set {_newMessage} to message
replace every "[money]" with "&a&l%{_n}% Money&r" in {_newMessage}
set message to {_newMessage}

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.

Thank you. The code you've shown is indeed making it working better, but [money] SURPRISINGLY doesn't still work. :emoji_disappointed_relieved:

code_language.skript:
on chat:
    if message contains "[money]":
        if player has permission "crypt.balitem":
            set {_newMessage} to message
            set {_n} to player's balance
            replace every "[money]" with "&a&l$%{_n}%&r" in {_newMessage}
            set message to {_newMessage}
        else:
            cancel event
            send "&e&l> &7You do not have permission to [money]! Unlock access at &ebuy.cryptmc.net&7."
[doublepost=1543618989,1543618731][/doublepost]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?
 
Thank you. The code you've shown is indeed making it working better, but [money] SURPRISINGLY doesn't still work. :emoji_disappointed_relieved:

code_language.skript:
on chat:
    if message contains "[money]":
        if player has permission "crypt.balitem":
            set {_newMessage} to message
            set {_n} to player's balance
            replace every "[money]" with "&a&l$%{_n}%&r" in {_newMessage}
            set message to {_newMessage}
        else:
            cancel event
            send "&e&l> &7You do not have permission to [money]! Unlock access at &ebuy.cryptmc.net&7."
[doublepost=1543618989,1543618731][/doublepost]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?
List all of your plugins. It's possible that your version of Skript doesn't support balance, or you don't have Vault.
 
List all of your plugins. It's possible that your version of Skript doesn't support balance, or you don't have Vault.
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?
 
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?
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.
 
Thank you,
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.
This is the best solution.
 
Status
Not open for further replies.