Skript

Skript

788k Downloads

Can't run function (reflection) with argument when Skent is installed

Closed this issue · 5 comments

commented

Skript/Server Version

[08:21:03 INFO]: [Skript] Skript's aliases can be found here: https://github.com/SkriptLang/skript-aliases
[08:21:03 INFO]: [Skript] Skript's documentation can be found here: https://docs.skriptlang.org/
[08:21:03 INFO]: [Skript] Skript's tutorials can be found here: https://docs.skriptlang.org/tutorials
[08:21:03 INFO]: [Skript] Server Version: 1.21.7-29-21fb542 (MC: 1.21.7)
[08:21:03 INFO]: [Skript] Skript Version: 2.12.1 (skriptlang-github)
[08:21:03 INFO]: [Skript] Installed Skript Addons:
[08:21:03 INFO]: [Skript]  - Skent v3.4.0
[08:21:03 INFO]: [Skript] Installed dependencies:
[08:21:03 INFO]: [Skript]  - WorldGuard v7.0.14+2339-43997ec

Bug Description

Using Skript's run function expression with an argument specified fails and throws an error in the console. This only occurs when Skent is installed, but it doesn't seem to be a conflict with its own because I'm running a modified version that I believe fixes the conflict (details in the other section.)

Expected Behavior

It should execute just like it does when Skent isn't installed.

Steps to Reproduce

With Skent installed (latest release or modified as stated below,) run this test function:

using reflection

command /reflectionNestTest:
	trigger:
		set {_fun} to function named "testFunction"
		broadcast "%{_fun}%"
		run {_fun} with arguments player

function testFunction(player: player):
	broadcast "Hello %{_player}%!"

Errors or Screenshots

[08:31:12 ERROR]: #!#!
[08:31:12 ERROR]: #!#! [Skript] Severe Error:
[08:31:12 ERROR]: #!#!
[08:31:12 ERROR]: #!#! An unexpected error occurred with Skript. This issue is likely not your fault.
[08:31:12 ERROR]: #!#! You are using some plugins that alter how Skript works (addons).
[08:31:12 ERROR]: #!#! Full list of addons:
[08:31:12 ERROR]: #!#! Skent v3.4.0
[08:31:12 ERROR]: #!#! We could not identify related addons, it might also be a Skript issue.
[08:31:12 ERROR]: #!#! Try temporarily removing the listed plugins one by one to identify the cause.
[08:31:12 ERROR]: #!#! If removing a plugin resolves the issue, please report the problem to the plugin developer.
[08:31:12 ERROR]: #!#!
[08:31:12 ERROR]: #!#! Stack trace:
[08:31:12 ERROR]: #!#! Caused by: java.lang.NullPointerException: Cannot invoke "ch.njol.skript.lang.Expression.getArray(org.bukkit.event.Event)" because "parameter.def" is null
[08:31:12 ERROR]: #!#!     at Skript-2.12.1.jar//ch.njol.skript.lang.function.Function.execute(Function.java:95)
[08:31:12 ERROR]: #!#!     at Skript-2.12.1.jar//ch.njol.skript.lang.function.DynamicFunctionReference.execute(DynamicFunctionReference.java:120)
[08:31:12 ERROR]: #!#!     at Skript-2.12.1.jar//ch.njol.skript.lang.function.DynamicFunctionReference.execute(DynamicFunctionReference.java:31)
[08:31:12 ERROR]: #!#!     at Skript-2.12.1.jar//ch.njol.skript.effects.EffRun.execute(EffRun.java:78)
[08:31:12 ERROR]: #!#!     at Skript-2.12.1.jar//ch.njol.skript.lang.Effect.run(Effect.java:42)
[08:31:12 ERROR]: #!#!     at Skript-2.12.1.jar//ch.njol.skript.lang.TriggerItem.walk(TriggerItem.java:40)
[08:31:12 ERROR]: #!#!     at Skript-2.12.1.jar//ch.njol.skript.lang.TriggerItem.walk(TriggerItem.java:67)
[08:31:12 ERROR]: #!#!     at Skript-2.12.1.jar//ch.njol.skript.lang.Trigger.execute(Trigger.java:33)
[08:31:12 ERROR]: #!#!     at Skript-2.12.1.jar//ch.njol.skript.command.ScriptCommand.execute2(ScriptCommand.java:352)
[08:31:12 ERROR]: #!#!     at Skript-2.12.1.jar//ch.njol.skript.command.ScriptCommand.lambda$execute$0(ScriptCommand.java:311)
[08:31:12 ERROR]: #!#!     at Skript-2.12.1.jar//ch.njol.skript.command.ScriptCommand.execute(ScriptCommand.java:322)
[08:31:12 ERROR]: #!#!     at Skript-2.12.1.jar//ch.njol.skript.command.ScriptCommand.onCommand(ScriptCommand.java:257)
[08:31:12 ERROR]: #!#!     at org.bukkit.command.PluginCommand.execute(PluginCommand.java:45)
[08:31:12 ERROR]: #!#!     at io.papermc.paper.command.brigadier.bukkit.BukkitCommandNode$BukkitBrigCommand.run(BukkitCommandNode.java:83)
[08:31:12 ERROR]: #!#!     at com.mojang.brigadier.context.ContextChain.runExecutable(ContextChain.java:73)
[08:31:12 ERROR]: #!#!     at net.minecraft.commands.execution.tasks.ExecuteCommand.execute(ExecuteCommand.java:30)
[08:31:12 ERROR]: #!#!     at net.minecraft.commands.execution.tasks.ExecuteCommand.execute(ExecuteCommand.java:13)
[08:31:12 ERROR]: #!#!     at net.minecraft.commands.execution.UnboundEntryAction.lambda$bind$0(UnboundEntryAction.java:8)
[08:31:12 ERROR]: #!#!     at net.minecraft.commands.execution.CommandQueueEntry.execute(CommandQueueEntry.java:5)
[08:31:12 ERROR]: #!#!     at net.minecraft.commands.execution.ExecutionContext.runCommandQueue(ExecutionContext.java:105)
[08:31:12 ERROR]: #!#!     at net.minecraft.commands.Commands.executeCommandInContext(Commands.java:451)
[08:31:12 ERROR]: #!#!     at net.minecraft.commands.Commands.performCommand(Commands.java:357)
[08:31:12 ERROR]: #!#!     at net.minecraft.commands.Commands.performCommand(Commands.java:345)
[08:31:12 ERROR]: #!#!     at net.minecraft.commands.Commands.performPrefixedCommand(Commands.java:336)
[08:31:12 ERROR]: #!#!     at net.minecraft.server.dedicated.DedicatedServer.handleConsoleInputs(DedicatedServer.java:435)
[08:31:12 ERROR]: #!#!     at net.minecraft.server.dedicated.DedicatedServer.tickConnection(DedicatedServer.java:386)
[08:31:12 ERROR]: #!#!     at net.minecraft.server.MinecraftServer.tickChildren(MinecraftServer.java:1738)
[08:31:12 ERROR]: #!#!     at net.minecraft.server.MinecraftServer.tickServer(MinecraftServer.java:1530)
[08:31:12 ERROR]: #!#!     at net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:1252)
[08:31:12 ERROR]: #!#!     at net.minecraft.server.MinecraftServer.lambda$spin$2(MinecraftServer.java:310)
[08:31:12 ERROR]: #!#!     at java.base/java.lang.Thread.run(Thread.java:1583)
[08:31:12 ERROR]: #!#!
[08:31:12 ERROR]: #!#! Skript: 2.12.1 (latest)
[08:31:12 ERROR]: #!#!     Flavor: skriptlang-github
[08:31:12 ERROR]: #!#!     Date: 15:49:27.046333
[08:31:12 ERROR]: #!#! Bukkit: 1.21.7-R0.1-SNAPSHOT
[08:31:12 ERROR]: #!#! Minecraft: 1.21.7
[08:31:12 ERROR]: #!#! Java: 21.0.3 (OpenJDK 64-Bit Server VM 21.0.3+9-LTS)
[08:31:12 ERROR]: #!#! OS: Windows 11 amd64 10.0
[08:31:12 ERROR]: #!#!
[08:31:12 ERROR]: #!#! Server platform: Paper
[08:31:12 ERROR]: #!#!
[08:31:12 ERROR]: #!#! Current node: null
[08:31:12 ERROR]: #!#! Current item: run {_fun} (as org.skriptlang.skript.util.Executable) with arguments the adult player
[08:31:12 ERROR]: #!#! Current trigger: command /reflectionnesttest (simple event) (test.sk, line 4)
[08:31:12 ERROR]: #!#! Thread: Server thread
[08:31:12 ERROR]: #!#! Language: english
[08:31:12 ERROR]: #!#! Link parse mode: DISABLED
[08:31:12 ERROR]: #!#! End of Error.
[08:31:12 ERROR]: #!#!

Other

I modified my version of Skent as such to make sure it wasn't the conflict to blame:
src/main/java/com/olyno/skent/skript/effects/process/EffExecuteFile.java, line 50:

    static {
        registerAsyncEffect(EffExecuteFile.class,
            "(execute|run|start) %paths% [with arg[ument][s] %-strings% [and]] [with env[ironment file[s]] %-paths% [and]] [(1¦with (logs|output))]"
        );
    }

changed to

    static {
        registerAsyncEffect(EffExecuteFile.class,
            "skent (execute|run|start) %paths% [with arg[ument][s] %-strings% [and]] [with env[ironment file[s]] %-paths% [and]] [(1¦with (logs|output))]"
        );
    }

I can't be 100% sure because I don't know my way around Skript addon code, but I'm pretty sure that should do it. The fact that it only happens with Skent installed does seem to indicate it's a Skent issue, but the fact that it still happens with the conflicting expression changed and that Skent never enters the stacktrace tells me it might not be.

Agreement

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

Does this still happen without skent installed?

commented

No, it works without Skent, but I can't tell why that would be because I tried it with a modified version of Skent that should resolve the conflict between the two run effects.

commented

Ahh then this is addon related and not a skript issue. We have an addon-development channel if you're still confused and need help regarding it in discord.gg/skript 😄

commented

Oh, nevermind, just tried it again and it does happen without Skent. Oops. I'll update my report.

commented

Ah, sorry, silly mistake. I was running this as a console to save time not thinking about how there wasn't a player present. Nevermind.