Tuke-Nuke / TuSKe

TuSKe is a Skript addons which brings some new cool things and some simple plugins hook.
18 stars 36 forks source link

The effect "cancel drops" is not working #8

Closed Agnax closed 7 years ago

Agnax commented 7 years ago

Here's what i made

on death:
    wait 1 tick
    if victim is a player:
        force victim to respawn 
        if "%region at victim%" do not contain "PvP":
            if {lifes.%victim%} > 0:
                remove 1 from {lifes.%victim%}
                send "&9Souls> &7You lost 1 soul, if you lose all your souls you will drop all your items upon death" to victim
                cancel drops
            else:
                send "&9Souls> &7You have lost all your souls, you dropped your items on the floor" to victim

Most of it works, it detects the death of the players sometimes, but the "cancel drops" never works What am I doing wrong?

Here is the error of the console if it works for you:

[19:16:37] [Server thread/ERROR]: #!#!
[19:16:37] [Server thread/ERROR]: #!#! [Skript] Severe Error:
[19:16:37] [Server thread/ERROR]: #!#!
[19:16:37] [Server thread/ERROR]: #!#! If you're developing an add-on for Skript this likely means that you have done something wrong.
[19:16:37] [Server thread/ERROR]: #!#! If you're a server admin however please go to https://github.com/bensku/Skript/issues/
[19:16:37] [Server thread/ERROR]: #!#! and check whether this error has already been reported.
[19:16:37] [Server thread/ERROR]: #!#! If not please create a new ticket with a meaningful title, copy & paste this whole error into it (or use paste service),
[19:16:37] [Server thread/ERROR]: #!#! and describe what you did before it happened and/or what you think caused the error.
[19:16:37] [Server thread/ERROR]: #!#! If you think that it's a trigger that's causing the error please post the trigger as well.
[19:16:37] [Server thread/ERROR]: #!#! By following this guide fixing the error should be easy and done fast.
[19:16:37] [Server thread/ERROR]: #!#!
[19:16:37] [Server thread/ERROR]: #!#! Stack trace:
[19:16:37] [Server thread/ERROR]: #!#! java.lang.NullPointerException
[19:16:37] [Server thread/ERROR]: #!#! at me.sharpjaws.sharpSK.hooks.WorldGuard.ExprRegionAt.get(ExprRegionAt.java:33)
[19:16:37] [Server thread/ERROR]: #!#! at me.sharpjaws.sharpSK.hooks.WorldGuard.ExprRegionAt.get(ExprRegionAt.java:1)
[19:16:37] [Server thread/ERROR]: #!#! at ch.njol.skript.lang.util.SimpleExpression.getArray(SimpleExpression.java:103)
[19:16:37] [Server thread/ERROR]: #!#! at ch.njol.skript.lang.VariableString.toString(VariableString.java:430)
[19:16:37] [Server thread/ERROR]: #!#! at ch.njol.skript.lang.VariableString.getAll(VariableString.java:599)
[19:16:37] [Server thread/ERROR]: #!#! at ch.njol.skript.lang.VariableString.check(VariableString.java:614)
[19:16:37] [Server thread/ERROR]: #!#! at ch.njol.skript.conditions.CondContains.check(CondContains.java:98)
[19:16:37] [Server thread/ERROR]: #!#! at ch.njol.skript.lang.Condition.run(Condition.java:56)
[19:16:37] [Server thread/ERROR]: #!#! at ch.njol.skript.lang.Conditional.walk(Conditional.java:51)
[19:16:37] [Server thread/ERROR]: #!#! at ch.njol.skript.lang.TriggerItem.walk(TriggerItem.java:89)
[19:16:37] [Server thread/ERROR]: #!#! at ch.njol.skript.lang.Trigger.execute(Trigger.java:55)
[19:16:37] [Server thread/ERROR]: #!#! at ch.njol.skript.SkriptEventHandler.check(SkriptEventHandler.java:151)
[19:16:37] [Server thread/ERROR]: #!#! at ch.njol.skript.SkriptEventHandler$1.execute(SkriptEventHandler.java:109)
[19:16:37] [Server thread/ERROR]: #!#! at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:62)
[19:16:37] [Server thread/ERROR]: #!#! at org.bukkit.plugin.SimplePluginManager.fireEvent(SimplePluginManager.java:502)
[19:16:37] [Server thread/ERROR]: #!#! at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:487)
[19:16:37] [Server thread/ERROR]: #!#! at org.bukkit.craftbukkit.v1_11_R1.event.CraftEventFactory.callPlayerDeathEvent(CraftEventFactory.java:412)
[19:16:37] [Server thread/ERROR]: #!#! at net.minecraft.server.v1_11_R1.EntityPlayer.die(EntityPlayer.java:419)
[19:16:37] [Server thread/ERROR]: #!#! at org.bukkit.craftbukkit.v1_11_R1.entity.CraftLivingEntity.setHealth(CraftLivingEntity.java:103)
[19:16:37] [Server thread/ERROR]: #!#! at com.earth2me.essentials.commands.Commandsuicide.run(Commandsuicide.java:24)
[19:16:37] [Server thread/ERROR]: #!#! at com.earth2me.essentials.commands.EssentialsCommand.run(EssentialsCommand.java:180)
[19:16:37] [Server thread/ERROR]: #!#! at com.earth2me.essentials.Essentials.onCommandEssentials(Essentials.java:526)
[19:16:37] [Server thread/ERROR]: #!#! at com.earth2me.essentials.Essentials.onCommand(Essentials.java:401)
[19:16:37] [Server thread/ERROR]: #!#! at org.bukkit.command.PluginCommand.execute(PluginCommand.java:44)
[19:16:37] [Server thread/ERROR]: #!#! at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:141)
[19:16:37] [Server thread/ERROR]: #!#! at org.bukkit.craftbukkit.v1_11_R1.CraftServer.dispatchCommand(CraftServer.java:650)
[19:16:37] [Server thread/ERROR]: #!#! at net.minecraft.server.v1_11_R1.PlayerConnection.handleCommand(PlayerConnection.java:1353)
[19:16:37] [Server thread/ERROR]: #!#! at net.minecraft.server.v1_11_R1.PlayerConnection.a(PlayerConnection.java:1188)
[19:16:37] [Server thread/ERROR]: #!#! at net.minecraft.server.v1_11_R1.PacketPlayInChat.a(PacketPlayInChat.java:45)
[19:16:37] [Server thread/ERROR]: #!#! at net.minecraft.server.v1_11_R1.PacketPlayInChat.a(PacketPlayInChat.java:1)
[19:16:37] [Server thread/ERROR]: #!#! at net.minecraft.server.v1_11_R1.PlayerConnectionUtils$1.run(SourceFile:13)
[19:16:37] [Server thread/ERROR]: #!#! at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
[19:16:37] [Server thread/ERROR]: #!#! at java.util.concurrent.FutureTask.run(FutureTask.java:266)
[19:16:37] [Server thread/ERROR]: #!#! at net.minecraft.server.v1_11_R1.SystemUtils.a(SourceFile:46)
[19:16:37] [Server thread/ERROR]: #!#! at net.minecraft.server.v1_11_R1.MinecraftServer.D(MinecraftServer.java:747)
[19:16:37] [Server thread/ERROR]: #!#! at net.minecraft.server.v1_11_R1.DedicatedServer.D(DedicatedServer.java:399)
[19:16:37] [Server thread/ERROR]: #!#! at net.minecraft.server.v1_11_R1.MinecraftServer.C(MinecraftServer.java:678)
[19:16:37] [Server thread/ERROR]: #!#! at net.minecraft.server.v1_11_R1.MinecraftServer.run(MinecraftServer.java:576)
[19:16:37] [Server thread/ERROR]: #!#! at java.lang.Thread.run(Thread.java:745)
[19:16:37] [Server thread/ERROR]: #!#!
[19:16:37] [Server thread/ERROR]: #!#! Version Information:
[19:16:37] [Server thread/ERROR]: #!#! Skript: 2.2-dev29
[19:16:37] [Server thread/ERROR]: #!#! Bukkit: 1.11.2-R0.1-SNAPSHOT
[19:16:37] [Server thread/ERROR]: #!#! Minecraft: 1.11.2
[19:16:37] [Server thread/ERROR]: #!#! Java: 1.8.0_112 (Java HotSpot(TM) 64-Bit Server VM 25.112-b15)
[19:16:37] [Server thread/ERROR]: #!#! OS: Linux amd64 3.14.32-xxxx-std-ipv6-64-hz1000
[19:16:37] [Server thread/ERROR]: #!#!
[19:16:37] [Server thread/ERROR]: #!#! Running CraftBukkit: false
[19:16:37] [Server thread/ERROR]: #!#!
[19:16:37] [Server thread/ERROR]: #!#! Current node: null
[19:16:37] [Server thread/ERROR]: Could not pass event PlayerDeathEvent to Skript v2.2-dev29
java.lang.NullPointerException
at me.sharpjaws.sharpSK.hooks.WorldGuard.ExprRegionAt.toString(ExprRegionAt.java:54) ~[?:?]
at ch.njol.skript.lang.VariableString.toString(VariableString.java:531) ~[?:?]
at ch.njol.skript.conditions.CondContains.toString(CondContains.java:134) ~[?:?]
at ch.njol.skript.lang.Conditional.toString(Conditional.java:63) ~[?:?]
at ch.njol.skript.Skript.exception(Skript.java:1270) ~[?:?]
at ch.njol.skript.Skript.exception(Skript.java:1220) ~[?:?]
at ch.njol.skript.lang.TriggerItem.walk(TriggerItem.java:100) ~[?:?]
at ch.njol.skript.lang.Trigger.execute(Trigger.java:55) ~[?:?]
at ch.njol.skript.SkriptEventHandler.check(SkriptEventHandler.java:151) ~[?:?]
at ch.njol.skript.SkriptEventHandler$1.execute(SkriptEventHandler.java:109) ~[?:?]
at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:62) ~[spigotmc-1.11.2-R0.1.jar:git-Spigot-625bc00-41a7d14]
at org.bukkit.plugin.SimplePluginManager.fireEvent(SimplePluginManager.java:502) [spigotmc-1.11.2-R0.1.jar:git-Spigot-625bc00-41a7d14]
at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:487) [spigotmc-1.11.2-R0.1.jar:git-Spigot-625bc00-41a7d14]
at org.bukkit.craftbukkit.v1_11_R1.event.CraftEventFactory.callPlayerDeathEvent(CraftEventFactory.java:412) [spigotmc-1.11.2-R0.1.jar:git-Spigot-625bc00-41a7d14]
at net.minecraft.server.v1_11_R1.EntityPlayer.die(EntityPlayer.java:419) [spigotmc-1.11.2-R0.1.jar:git-Spigot-625bc00-41a7d14]
at org.bukkit.craftbukkit.v1_11_R1.entity.CraftLivingEntity.setHealth(CraftLivingEntity.java:103) [spigotmc-1.11.2-R0.1.jar:git-Spigot-625bc00-41a7d14]
at com.earth2me.essentials.commands.Commandsuicide.run(Commandsuicide.java:24) [Essentials-2.x-SNAPSHOT.jar:?]
at com.earth2me.essentials.commands.EssentialsCommand.run(EssentialsCommand.java:180) [Essentials-2.x-SNAPSHOT.jar:?]
at com.earth2me.essentials.Essentials.onCommandEssentials(Essentials.java:526) [Essentials-2.x-SNAPSHOT.jar:?]
at com.earth2me.essentials.Essentials.onCommand(Essentials.java:401) [Essentials-2.x-SNAPSHOT.jar:?]
at org.bukkit.command.PluginCommand.execute(PluginCommand.java:44) [spigotmc-1.11.2-R0.1.jar:git-Spigot-625bc00-41a7d14]
at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:141) [spigotmc-1.11.2-R0.1.jar:git-Spigot-625bc00-41a7d14]
at org.bukkit.craftbukkit.v1_11_R1.CraftServer.dispatchCommand(CraftServer.java:650) [spigotmc-1.11.2-R0.1.jar:git-Spigot-625bc00-41a7d14]
at net.minecraft.server.v1_11_R1.PlayerConnection.handleCommand(PlayerConnection.java:1353) [spigotmc-1.11.2-R0.1.jar:git-Spigot-625bc00-41a7d14]
at net.minecraft.server.v1_11_R1.PlayerConnection.a(PlayerConnection.java:1188) [spigotmc-1.11.2-R0.1.jar:git-Spigot-625bc00-41a7d14]
at net.minecraft.server.v1_11_R1.PacketPlayInChat.a(PacketPlayInChat.java:45) [spigotmc-1.11.2-R0.1.jar:git-Spigot-625bc00-41a7d14]
at net.minecraft.server.v1_11_R1.PacketPlayInChat.a(PacketPlayInChat.java:1) [spigotmc-1.11.2-R0.1.jar:git-Spigot-625bc00-41a7d14]
at net.minecraft.server.v1_11_R1.PlayerConnectionUtils$1.run(SourceFile:13) [spigotmc-1.11.2-R0.1.jar:git-Spigot-625bc00-41a7d14]
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [?:1.8.0_112]
at java.util.concurrent.FutureTask.run(FutureTask.java:266) [?:1.8.0_112]
at net.minecraft.server.v1_11_R1.SystemUtils.a(SourceFile:46) [spigotmc-1.11.2-R0.1.jar:git-Spigot-625bc00-41a7d14]
at net.minecraft.server.v1_11_R1.MinecraftServer.D(MinecraftServer.java:747) [spigotmc-1.11.2-R0.1.jar:git-Spigot-625bc00-41a7d14]
at net.minecraft.server.v1_11_R1.DedicatedServer.D(DedicatedServer.java:399) [spigotmc-1.11.2-R0.1.jar:git-Spigot-625bc00-41a7d14]
at net.minecraft.server.v1_11_R1.MinecraftServer.C(MinecraftServer.java:678) [spigotmc-1.11.2-R0.1.jar:git-Spigot-625bc00-41a7d14]
at net.minecraft.server.v1_11_R1.MinecraftServer.run(MinecraftServer.java:576) [spigotmc-1.11.2-R0.1.jar:git-Spigot-625bc00-41a7d14]
at java.lang.Thread.run(Thread.java:745) [?:1.8.0_112]
Tuke-Nuke commented 7 years ago

First, cancel the drops should be only used before any wait a tick effect (which I forgot to properly warn it). But, this issue is related to SharpSK. But, just to be sure if it is working, try like this:

on death:
    if victim is a player:
        cancel the drops
        wait 1 tick
        force victim to respawn 

Since the issue happens with region at %player% (Probably SharpSK is overriding it).

Tuke-Nuke commented 7 years ago

I contacted the dev of SharpSK it seens to be already fixed in his latest release since he can't reproduce it. In case you see this and still having that issue after updating to latest SharpSK. Try to contact him with more details.