Skript

Skript

743k Downloads

ExprRandom missing canInitSafely

Gabryxplay15 opened this issue ยท 3 comments

commented

Skript/Server Version

Server version: 3096a-Spigot-9fb885e-af1a232 (MC: 1.16.5)
Skript version: 2.8.3 (skriptlang-github)
Installed skript addons: none
installed dependencies: Vault v1.7.3-b131

Bug Description

I was developing a skript for my realistic roleplay, and then i saw this on my console while realoding the skript:

[18:01:01] [Server thread/ERROR]: #!#! 
[18:01:01] [Server thread/ERROR]: #!#! [Skript] Severe Error:
[18:01:01] [Server thread/ERROR]: #!#! 
[18:01:01] [Server thread/ERROR]: #!#! Something went horribly wrong with Skript.
[18:01:01] [Server thread/ERROR]: #!#! This issue is NOT your fault! You probably can't fix it yourself, either.
[18:01:01] [Server thread/ERROR]: #!#! You should report it at https://github.com/SkriptLang/Skript/issues. Please copy paste this report there (or use paste service).
[18:01:01] [Server thread/ERROR]: #!#! This ensures that your issue is noticed and will be fixed as soon as possible.
[18:01:01] [Server thread/ERROR]: #!#! 
[18:01:01] [Server thread/ERROR]: #!#! Stack trace:
[18:01:01] [Server thread/ERROR]: #!#! ch.njol.skript.SkriptAPIException: UnparsedLiterals must be converted before use
[18:01:01] [Server thread/ERROR]: #!#!     at ch.njol.skript.lang.UnparsedLiteral.invalidAccessException(UnparsedLiteral.java:142)
[18:01:01] [Server thread/ERROR]: #!#!     at ch.njol.skript.lang.UnparsedLiteral.getAll(UnparsedLiteral.java:152)
[18:01:01] [Server thread/ERROR]: #!#!     at ch.njol.skript.expressions.ExprRandom.get(ExprRandom.java:88)
[18:01:01] [Server thread/ERROR]: #!#!     at ch.njol.skript.lang.util.SimpleExpression.getArray(SimpleExpression.java:94)
[18:01:01] [Server thread/ERROR]: #!#!     at ch.njol.skript.effects.EffChange.execute(EffChange.java:284)
[18:01:01] [Server thread/ERROR]: #!#!     at ch.njol.skript.lang.Effect.run(Effect.java:49)
[18:01:01] [Server thread/ERROR]: #!#!     at ch.njol.skript.lang.TriggerItem.walk(TriggerItem.java:61)
[18:01:01] [Server thread/ERROR]: #!#!     at ch.njol.skript.lang.TriggerItem.walk(TriggerItem.java:88)
[18:01:01] [Server thread/ERROR]: #!#!     at ch.njol.skript.lang.Trigger.execute(Trigger.java:52)
[18:01:01] [Server thread/ERROR]: #!#!     at ch.njol.skript.events.EvtScript.runTrigger(EvtScript.java:88)
[18:01:01] [Server thread/ERROR]: #!#!     at ch.njol.skript.events.EvtScript.postLoad(EvtScript.java:61)
[18:01:01] [Server thread/ERROR]: #!#!     at ch.njol.skript.structures.StructEvent.postLoad(StructEvent.java:79)
[18:01:01] [Server thread/ERROR]: #!#!     at ch.njol.skript.ScriptLoader.lambda$loadScripts$9(ScriptLoader.java:589)
[18:01:01] [Server thread/ERROR]: #!#!     at java.base/java.util.ArrayList.removeIf(ArrayList.java:1672)
[18:01:01] [Server thread/ERROR]: #!#!     at java.base/java.util.ArrayList.removeIf(ArrayList.java:1660)
[18:01:01] [Server thread/ERROR]: #!#!     at ch.njol.skript.ScriptLoader.lambda$loadScripts$10(ScriptLoader.java:581)
[18:01:01] [Server thread/ERROR]: #!#!     at java.base/java.util.concurrent.CompletableFuture.uniApplyNow(CompletableFuture.java:680)
[18:01:01] [Server thread/ERROR]: #!#!     at java.base/java.util.concurrent.CompletableFuture.uniApplyStage(CompletableFuture.java:658)
[18:01:01] [Server thread/ERROR]: #!#!     at java.base/java.util.concurrent.CompletableFuture.thenApply(CompletableFuture.java:2164)
[18:01:01] [Server thread/ERROR]: #!#!     at ch.njol.skript.ScriptLoader.loadScripts(ScriptLoader.java:511)
[18:01:01] [Server thread/ERROR]: #!#!     at ch.njol.skript.ScriptLoader.loadScripts(ScriptLoader.java:457)
[18:01:01] [Server thread/ERROR]: #!#!     at ch.njol.skript.SkriptCommand.onCommand(SkriptCommand.java:190)
[18:01:01] [Server thread/ERROR]: #!#!     at org.bukkit.command.PluginCommand.execute(PluginCommand.java:45)
[18:01:01] [Server thread/ERROR]: #!#!     at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:149)
[18:01:01] [Server thread/ERROR]: #!#!     at org.bukkit.craftbukkit.v1_16_R3.CraftServer.dispatchCommand(CraftServer.java:761)
[18:01:01] [Server thread/ERROR]: #!#!     at net.minecraft.server.v1_16_R3.PlayerConnection.handleCommand(PlayerConnection.java:1936)
[18:01:01] [Server thread/ERROR]: #!#!     at net.minecraft.server.v1_16_R3.PlayerConnection.c(PlayerConnection.java:1779)
[18:01:01] [Server thread/ERROR]: #!#!     at net.minecraft.server.v1_16_R3.PlayerConnection.a(PlayerConnection.java:1732)
[18:01:01] [Server thread/ERROR]: #!#!     at net.minecraft.server.v1_16_R3.PacketPlayInChat.a(PacketPlayInChat.java:49)
[18:01:01] [Server thread/ERROR]: #!#!     at net.minecraft.server.v1_16_R3.PacketPlayInChat.a(PacketPlayInChat.java:1)
[18:01:01] [Server thread/ERROR]: #!#!     at net.minecraft.server.v1_16_R3.PlayerConnectionUtils.lambda$0(PlayerConnectionUtils.java:28)
[18:01:01] [Server thread/ERROR]: #!#!     at net.minecraft.server.v1_16_R3.TickTask.run(SourceFile:18)
[18:01:01] [Server thread/ERROR]: #!#!     at net.minecraft.server.v1_16_R3.IAsyncTaskHandler.executeTask(SourceFile:144)
[18:01:01] [Server thread/ERROR]: #!#!     at net.minecraft.server.v1_16_R3.IAsyncTaskHandlerReentrant.executeTask(SourceFile:23)
[18:01:01] [Server thread/ERROR]: #!#!     at net.minecraft.server.v1_16_R3.IAsyncTaskHandler.executeNext(SourceFile:118)
[18:01:01] [Server thread/ERROR]: #!#!     at net.minecraft.server.v1_16_R3.MinecraftServer.bb(MinecraftServer.java:1061)
[18:01:01] [Server thread/ERROR]: #!#!     at net.minecraft.server.v1_16_R3.MinecraftServer.executeNext(MinecraftServer.java:1054)
[18:01:01] [Server thread/ERROR]: #!#!     at net.minecraft.server.v1_16_R3.IAsyncTaskHandler.awaitTasks(SourceFile:127)
[18:01:01] [Server thread/ERROR]: #!#!     at net.minecraft.server.v1_16_R3.MinecraftServer.sleepForTick(MinecraftServer.java:1038)
[18:01:01] [Server thread/ERROR]: #!#!     at net.minecraft.server.v1_16_R3.MinecraftServer.w(MinecraftServer.java:970)
[18:01:01] [Server thread/ERROR]: #!#!     at net.minecraft.server.v1_16_R3.MinecraftServer.lambda$0(MinecraftServer.java:273)
[18:01:01] [Server thread/ERROR]: #!#!     at java.base/java.lang.Thread.run(Thread.java:831)
[18:01:01] [Server thread/ERROR]: #!#! 
[18:01:01] [Server thread/ERROR]: #!#! Version Information:
[18:01:01] [Server thread/ERROR]: #!#!   Skript: 2.8.3 (latest)
[18:01:01] [Server thread/ERROR]: #!#!     Flavor: skriptlang-github
[18:01:01] [Server thread/ERROR]: #!#!     Date: 16:23:04.254419600
[18:01:01] [Server thread/ERROR]: #!#!   Bukkit: 1.16.5-R0.1-SNAPSHOT
[18:01:01] [Server thread/ERROR]: #!#!   Minecraft: 1.16.5
[18:01:01] [Server thread/ERROR]: #!#!   Java: 16.0.2 (OpenJDK 64-Bit Server VM 16.0.2+7)
[18:01:01] [Server thread/ERROR]: #!#!   OS: Linux amd64 4.18.0-477.13.1.el8_8.x86_64
[18:01:01] [Server thread/ERROR]: #!#! 
[18:01:01] [Server thread/ERROR]: #!#! Server platform: Spigot
[18:01:01] [Server thread/ERROR]: #!#! 
[18:01:01] [Server thread/ERROR]: #!#! Current node: on load: (medical.sk, line 44)
[18:01:01] [Server thread/ERROR]: #!#! Current item: set {_randomPlayer} (as java.lang.Object) to a random element out of 'online players'
[18:01:01] [Server thread/ERROR]: #!#! Current trigger: load (script load) (medical.sk, line 44)
[18:01:01] [Server thread/ERROR]: #!#! 
[18:01:01] [Server thread/ERROR]: #!#! Thread: Server thread
[18:01:01] [Server thread/ERROR]: #!#! 
[18:01:01] [Server thread/ERROR]: #!#! Language: english
[18:01:01] [Server thread/ERROR]: #!#! Link parse mode: DISABLED
[18:01:01] [Server thread/ERROR]: #!#! 
[18:01:01] [Server thread/ERROR]: #!#! End of Error.
[18:01:01] [Server thread/ERROR]: #!#! 

Expected Behavior

I was creating a system to give ppl random diaseases and this happend

Steps to Reproduce

i added this to the skript:

on load:
    loop 500 times:
        set {_randomPlayer} to random player of online players
        set {_malattiaCasuale} to random integer between 1 and 3
        if {_malattiaCasuale} is 1:
            add {_randomPlayer} to {febbre}
            send title "&cSTAI MALE" with subtitle "&eTi senti molto accaldato" to {_randomPlayer} for 4 seconds
            apply slowness 2 to {_randomPlayer} for 10 seconds
            apply poison 1 to {_randomPlayer} for 5 seconds
            apply nausea 1 to {_randomPlayer} for 3 seconds
        else if {_malattiaCasuale} is 2:
            add {_randomPlayer} to {ipotermia}
            send title "&cSTAI MALE" with subtitle "&eSenti molto freddo" to {_randomPlayer} for 4 seconds
            apply slowness 2 to {_randomPlayer} for 10 seconds
            apply nausea 1 to {_randomPlayer} for 2 seconds
        else if {_malattiaCasuale} is 3:
            add {_randomPlayer} to {intossicazione}
            send title "&cSTAI MALE" with subtitle "&eSenti una forte nausea" to {_randomPlayer} for 4 seconds
            apply slowness 2 to {_randomPlayer} for 10 seconds
            apply poison 2 to {_randomPlayer} for 5 seconds
            apply hunger 2 to {_randomPlayer} for 3 seconds
            apply nausea 3 to {_randomPlayer} for 10 seconds
        wait 3 minutes

on load:
	loop 500 times:
		apply slowness 2 to {febbre::*} for 10 seconds
		apply poison 1 to {febbre::*} for 5 seconds
		apply nausea 1 to {febbre::*} for 3 seconds
		send title "&cSTAI MALE" with subtitle "&eTi senti molto accaldato" to {febbre::*} for 4 seconds
		apply slowness 2 to {intossicazione::*} for 10 seconds
		apply poison 2 to {intossicazione::*} for 5 seconds
		apply hunger 2 to {intossicazione::*} for 3 seconds
		apply nausea 3 to {intossicazione::*} for 10 seconds
		send title "&c&lSTAI MALE" with subtitle "&eSenti una forte nausea e un forte mal di pancia" to {intossicazione::*} for 4 seconds
		wait 180 seconds

Errors or Screenshots

No response

Other

No response

Agreement

  • I have read the guidelines above and affirm I am following them with this report.
commented

Ok so, i tried to remove that code from my skript and it worked! I guess there is something wrong with it. Can someone help me?

commented

Yes thanks

commented

Close?