Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Functions don't work properly #2384

Closed
Thibaut040 opened this issue Aug 18, 2019 · 2 comments
Closed

Functions don't work properly #2384

Thibaut040 opened this issue Aug 18, 2019 · 2 comments
Labels
bug An issue that needs to be fixed. Alternatively, a PR fixing an issue. completed The issue has been fully resolved and the change will be in the next Skript update. priority: medium Issues that are detrimental to user experience (prohibitive bugs or lack of useful implementation).

Comments

@Thibaut040
Copy link

Description

I got an error when I use the function "max".

Steps to Reproduce

command /test: trigger: delete {test::*} add "test", "test2" and "test3" to {test::*} message "%max({test::*})%" to the executor stop

Expected Behavior

Just the function :)

Errors / Screenshots

[17:41:00] [Server thread/ERROR]: #!#!
[17:41:00] [Server thread/ERROR]: #!#! [Skript] Severe Error:
[17:41:00] [Server thread/ERROR]: #!#!
[17:41:00] [Server thread/ERROR]: #!#! Something went horribly wrong with Skript.
[17:41:00] [Server thread/ERROR]: #!#! This issue is NOT your fault! You probably can't fix it yourself, either.
[17:41:00] [Server thread/ERROR]: #!#! You should report it at https://github.com/SkriptLang/Skript/issues. Please copy paste this report there (or use paste service).
[17:41:00] [Server thread/ERROR]: #!#! This ensures that your issue is noticed and will be fixed as soon as possible.
[17:41:00] [Server thread/ERROR]: #!#!
[17:41:00] [Server thread/ERROR]: #!#! Stack trace:
[17:41:00] [Server thread/ERROR]: #!#! java.lang.ArrayIndexOutOfBoundsException: 0
[17:41:00] [Server thread/ERROR]: #!#! at ch.njol.skript.classes.data.DefaultFunctions$20.execute(DefaultFunctions.java:265)
[17:41:00] [Server thread/ERROR]: #!#! at ch.njol.skript.classes.data.DefaultFunctions$20.execute(DefaultFunctions.java:1)
[17:41:00] [Server thread/ERROR]: #!#! at ch.njol.skript.lang.function.Function.execute(Function.java:119)
[17:41:00] [Server thread/ERROR]: #!#! at ch.njol.skript.lang.function.FunctionReference.execute(FunctionReference.java:217)
[17:41:00] [Server thread/ERROR]: #!#! at ch.njol.skript.lang.function.ExprFunctionCall.get(ExprFunctionCall.java:44)
[17:41:00] [Server thread/ERROR]: #!#! at ch.njol.skript.lang.util.SimpleExpression.getArray(SimpleExpression.java:102)
[17:41:00] [Server thread/ERROR]: #!#! at ch.njol.skript.lang.VariableString.getMessageComponents(VariableString.java:584)
[17:41:00] [Server thread/ERROR]: #!#! at ch.njol.skript.effects.EffMessage.execute(EffMessage.java:89)
[17:41:00] [Server thread/ERROR]: #!#! at ch.njol.skript.lang.Effect.run(Effect.java:52)
[17:41:00] [Server thread/ERROR]: #!#! at ch.njol.skript.lang.TriggerItem.walk(TriggerItem.java:61)
[17:41:00] [Server thread/ERROR]: #!#! at ch.njol.skript.lang.TriggerItem.walk(TriggerItem.java:89)
[17:41:00] [Server thread/ERROR]: #!#! at ch.njol.skript.lang.Trigger.execute(Trigger.java:57)
[17:41:00] [Server thread/ERROR]: #!#! at ch.njol.skript.command.ScriptCommand.execute2(ScriptCommand.java:292)
[17:41:00] [Server thread/ERROR]: #!#! at ch.njol.skript.command.ScriptCommand.execute(ScriptCommand.java:251)
[17:41:00] [Server thread/ERROR]: #!#! at ch.njol.skript.command.Commands.handleCommand(Commands.java:252)
[17:41:00] [Server thread/ERROR]: #!#! at ch.njol.skript.command.Commands$1.onPlayerCommand(Commands.java:169)
[17:41:00] [Server thread/ERROR]: #!#! at sun.reflect.GeneratedMethodAccessor59.invoke(Unknown Source)
[17:41:00] [Server thread/ERROR]: #!#! at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
[17:41:00] [Server thread/ERROR]: #!#! at java.lang.reflect.Method.invoke(Unknown Source)
[17:41:00] [Server thread/ERROR]: #!#! at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:316)
[17:41:00] [Server thread/ERROR]: #!#! at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:70)
[17:41:00] [Server thread/ERROR]: #!#! at org.bukkit.plugin.SimplePluginManager.fireEvent(SimplePluginManager.java:529)
[17:41:00] [Server thread/ERROR]: #!#! at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:514)
[17:41:00] [Server thread/ERROR]: #!#! at net.minecraft.server.v1_14_R1.PlayerConnection.handleCommand(PlayerConnection.java:1633)
[17:41:00] [Server thread/ERROR]: #!#! at net.minecraft.server.v1_14_R1.PlayerConnection.a(PlayerConnection.java:1481)
[17:41:00] [Server thread/ERROR]: #!#! at net.minecraft.server.v1_14_R1.PacketPlayInChat.a(PacketPlayInChat.java:47)
[17:41:00] [Server thread/ERROR]: #!#! at net.minecraft.server.v1_14_R1.PacketPlayInChat.a(PacketPlayInChat.java:1)
[17:41:00] [Server thread/ERROR]: #!#! at net.minecraft.server.v1_14_R1.PlayerConnectionUtils.lambda$0(PlayerConnectionUtils.java:19)
[17:41:00] [Server thread/ERROR]: #!#! at net.minecraft.server.v1_14_R1.TickTask.run(SourceFile:18)
[17:41:00] [Server thread/ERROR]: #!#! at net.minecraft.server.v1_14_R1.IAsyncTaskHandler.executeTask(SourceFile:144)
[17:41:00] [Server thread/ERROR]: #!#! at net.minecraft.server.v1_14_R1.IAsyncTaskHandlerReentrant.executeTask(SourceFile:23)
[17:41:00] [Server thread/ERROR]: #!#! at net.minecraft.server.v1_14_R1.IAsyncTaskHandler.executeNext(SourceFile:118)
[17:41:00] [Server thread/ERROR]: #!#! at net.minecraft.server.v1_14_R1.MinecraftServer.aX(MinecraftServer.java:910)
[17:41:00] [Server thread/ERROR]: #!#! at net.minecraft.server.v1_14_R1.MinecraftServer.executeNext(MinecraftServer.java:903)
[17:41:00] [Server thread/ERROR]: #!#! at net.minecraft.server.v1_14_R1.IAsyncTaskHandler.executeAll(SourceFile:103)
[17:41:00] [Server thread/ERROR]: #!#! at net.minecraft.server.v1_14_R1.MinecraftServer.sleepForTick(MinecraftServer.java:886)
[17:41:00] [Server thread/ERROR]: #!#! at net.minecraft.server.v1_14_R1.MinecraftServer.run(MinecraftServer.java:820)
[17:41:00] [Server thread/ERROR]: #!#! at java.lang.Thread.run(Unknown Source)
[17:41:00] [Server thread/ERROR]: #!#!
[17:41:00] [Server thread/ERROR]: #!#! Version Information:
[17:41:00] [Server thread/ERROR]: #!#! Skript: 2.4-beta5 (latest)
[17:41:00] [Server thread/ERROR]: #!#! Flavor: skriptlang-github
[17:41:00] [Server thread/ERROR]: #!#! Date: 2019-08-04
[17:41:00] [Server thread/ERROR]: #!#! Bukkit: 1.14.4-R0.1-SNAPSHOT
[17:41:00] [Server thread/ERROR]: #!#! Minecraft: 1.14.4
[17:41:00] [Server thread/ERROR]: #!#! Java: 1.8.0_221 (Java HotSpot(TM) 64-Bit Server VM 25.221-b11)
[17:41:00] [Server thread/ERROR]: #!#! OS: Windows 10 amd64 10.0
[17:41:00] [Server thread/ERROR]: #!#!
[17:41:00] [Server thread/ERROR]: #!#! Server platform: Spigot
[17:41:00] [Server thread/ERROR]: #!#!
[17:41:00] [Server thread/ERROR]: #!#! Current node: null
[17:41:00] [Server thread/ERROR]: #!#! Current item: send "%max({test17::*}(as java.lang.Number))%" to the command sender
[17:41:00] [Server thread/ERROR]: #!#! Current trigger: command /test17 (simple event) (test.sk, line -1)
[17:41:00] [Server thread/ERROR]: #!#!
[17:41:00] [Server thread/ERROR]: #!#! Thread: Server thread
[17:41:00] [Server thread/ERROR]: #!#!
[17:41:00] [Server thread/ERROR]: #!#! Language: english
[17:41:00] [Server thread/ERROR]: #!#! Link parse mode: DISABLED
[17:41:00] [Server thread/ERROR]: #!#!
[17:41:00] [Server thread/ERROR]: #!#! End of Error.
[17:41:00] [Server thread/ERROR]: #!#!

Server Information

  • Server version/platform: Spigot 1.14.4
  • Skript version: Skript 2.4-beta5
@ShaneBeee
Copy link
Contributor

first of all let me reformat this so its readable

command /test: 
    trigger: 
        delete {test::*} 
        add "test", "test2" and "test3" to {test::*} 
        message "%max({test::*})%" to the executor 
        stop

second of all:
Screen Shot 2019-08-18 at 4 54 44 PM
As you can see by the image above, the max function takes in numbers
and add "test", "test2" and "test3" to {test::*} <-- clearly not numbers, they're strings, so obviously you are going to get errors

@FranKusmiruk FranKusmiruk added bug An issue that needs to be fixed. Alternatively, a PR fixing an issue. priority: medium Issues that are detrimental to user experience (prohibitive bugs or lack of useful implementation). labels Aug 19, 2019
@Matocolotoe
Copy link
Contributor

@ShaneBeee The problem is that before some update, when not using numbers or empty lists in this kind of functions, you didn't get this big error and none was returned

@Wealthyturtle Wealthyturtle added the completed The issue has been fully resolved and the change will be in the next Skript update. label Oct 21, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug An issue that needs to be fixed. Alternatively, a PR fixing an issue. completed The issue has been fully resolved and the change will be in the next Skript update. priority: medium Issues that are detrimental to user experience (prohibitive bugs or lack of useful implementation).
Projects
None yet
Development

No branches or pull requests

5 participants