CommandHelper

CommandHelper

46.5k Downloads

Unhandled exception when using die() in a registered command

LadyCailinBot opened this issue ยท 4 comments

commented

CMDHELPER-2906 - Reported by PseudoKnight

register_command('test', array(
	'executor': closure(@alias, @sender, @args, @info,
		die()
	)
))
[03:02:31] [Server thread/INFO]: PseudoKnight issued server command: /test
[03:02:31] [Server thread/ERROR]: null
org.bukkit.command.CommandException: Unhandled exception executing command 'test' in plugin CommandHelper v3.3.1-SNAPSHOT:2601-68071fd,master
	at org.bukkit.command.PluginCommand.execute(PluginCommand.java:46) ~[spigot.jar:git-Spigot-1312]
	at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:199) ~[spigot.jar:git-Spigot-1312]
	at org.bukkit.craftbukkit.v1_7_R1.CraftServer.dispatchCommand(CraftServer.java:547) ~[spigot.jar:git-Spigot-1312]
	at net.minecraft.server.v1_7_R1.PlayerConnection.handleCommand(PlayerConnection.java:972) [spigot.jar:git-Spigot-1312]
	at net.minecraft.server.v1_7_R1.PlayerConnection.a(PlayerConnection.java:817) [spigot.jar:git-Spigot-1312]
	at net.minecraft.server.v1_7_R1.PacketPlayInChat.a(PacketPlayInChat.java:28) [spigot.jar:git-Spigot-1312]
	at net.minecraft.server.v1_7_R1.PacketPlayInChat.handle(PacketPlayInChat.java:65) [spigot.jar:git-Spigot-1312]
	at net.minecraft.server.v1_7_R1.NetworkManager.a(NetworkManager.java:147) [spigot.jar:git-Spigot-1312]
	at net.minecraft.server.v1_7_R1.ServerConnection.c(ServerConnection.java:77) [spigot.jar:git-Spigot-1312]
	at net.minecraft.server.v1_7_R1.MinecraftServer.u(MinecraftServer.java:698) [spigot.jar:git-Spigot-1312]
	at net.minecraft.server.v1_7_R1.DedicatedServer.u(DedicatedServer.java:273) [spigot.jar:git-Spigot-1312]
	at net.minecraft.server.v1_7_R1.MinecraftServer.t(MinecraftServer.java:560) [spigot.jar:git-Spigot-1312]
	at net.minecraft.server.v1_7_R1.MinecraftServer.run(MinecraftServer.java:467) [spigot.jar:git-Spigot-1312]
	at net.minecraft.server.v1_7_R1.ThreadServerApplication.run(SourceFile:617) [spigot.jar:git-Spigot-1312]
Caused by: com.laytonsmith.core.exceptions.CancelCommandException: 
	at com.laytonsmith.core.functions.Echoes$die.exec(Echoes.java:49) ~[?:?]
	at com.laytonsmith.core.Script.eval(Script.java:332) ~[?:?]
	at com.laytonsmith.core.MethodScriptCompiler.execute(MethodScriptCompiler.java:1692) ~[?:?]
	at com.laytonsmith.core.MethodScriptCompiler.execute(MethodScriptCompiler.java:1652) ~[?:?]
	at com.laytonsmith.core.constructs.CClosure.execute(CClosure.java:144) ~[?:?]
	at com.laytonsmith.abstraction.bukkit.BukkitMCCommand.handleCustomCommand(BukkitMCCommand.java:239) ~[?:?]
	at com.laytonsmith.commandhelper.CommandHelperPlugin.onCommand(CommandHelperPlugin.java:498) ~[?:?]
	at org.bukkit.command.PluginCommand.execute(PluginCommand.java:44) ~[spigot.jar:git-Spigot-1312]
	... 13 more
commented

Comment by jb_aero

I probably should have asked you, what does it do normally in closures?

commented

Comment by PseudoKnight

  die('Message')
))```

Stops the script and says "Message".
commented

Comment by jb_aero

I don't have access to a server, can you try
/herp = store_value('example', closure(die('message')))
/derp = execute(get_value('example'))

commented

Comment by PseudoKnight

No matter what I put in the closure, it gives this: "FormatException: The type of CClosure in not currently supported:" followed by the first function name I put in the closure, whether it's "die" or "msg" or "console" or "assign".