Error With Hitdelay

Discussion in 'Spigot Plugin Development' started by eMuffin, Jul 13, 2018.

  1. Code (Text):

    13.07 01:54:02 [Server] INFO at [?:1.8.0_151]
    13.07 01:54:02 [Server] INFO at [paperspigot.jar:git-Paper-1488]
    13.07 01:54:02 [Server] INFO at net.minecraft.server.v1_12_R1.MinecraftServer.C( [paperspigot.jar:git-Paper-1488]
    13.07 01:54:02 [Server] INFO at net.minecraft.server.v1_12_R1.DedicatedServer.D( [paperspigot.jar:git-Paper-1488]
    13.07 01:54:02 [Server] INFO at net.minecraft.server.v1_12_R1.MinecraftServer.D( [paperspigot.jar:git-Paper-1488]
    13.07 01:54:02 [Server] INFO at net.minecraft.server.v1_12_R1.SystemUtils.a(SourceFile:46) [paperspigot.jar:git-Paper-1488]
    13.07 01:54:02 [Server] INFO at [?:1.8.0_151] 1
    3.07 01:54:02 [Server] INFO at java.util.concurrent.Executors$ [?:1.8.0_151]
    13.07 01:54:02 [Server] INFO at net.minecraft.server.v1_12_R1.PlayerConnectionUtils.lambda$ensureMainThread$0( ~[paperspigot.jar:git-Paper-1488]
    13.07 01:54:02 [Server] INFO at net.minecraft.server.v1_12_R1.PacketPlayInUseEntity.a( ~[paperspigot.jar:git-Paper-1488]
    13.07 01:54:02 [Server] INFO at net.minecraft.server.v1_12_R1.PacketPlayInUseEntity.a( ~[paperspigot.jar:git-Paper-1488]
    13.07 01:54:02 [Server] INFO at net.minecraft.server.v1_12_R1.PlayerConnection.a( ~[paperspigot.jar:git-Paper-1488]
    13.07 01:54:02 [Server] INFO at net.minecraft.server.v1_12_R1.EntityPlayer.attack( ~[paperspigot.jar:git-Paper-1488]
    13.07 01:54:02 [Server] INFO at net.minecraft.server.v1_12_R1.EntityHuman.attack( ~[paperspigot.jar:git-Paper-1488]
    13.07 01:54:02 [Server] INFO at net.minecraft.server.v1_12_R1.EntityZombie.damageEntity( ~[paperspigot.jar:git-Paper-1488]
    13.07 01:54:02 [Server] INFO at net.minecraft.server.v1_12_R1.EntityMonster.damageEntity( ~[paperspigot.jar:git-Paper-1488]
    13.07 01:54:02 [Server] INFO at net.minecraft.server.v1_12_R1.EntityLiving.damageEntity( ~[paperspigot.jar:git-Paper-1488]
    13.07 01:54:02 [Server] INFO at net.minecraft.server.v1_12_R1.EntityLiving.damageEntity0( ~[paperspigot.jar:git-Paper-1488] 13.07 01:54:02 [Server] INFO at org.bukkit.craftbukkit.v1_12_R1.event.CraftEventFactory.handleLivingEntityDamageEvent( ~[paperspigot.jar:git-Paper-1488]
    13.07 01:54:02 [Server] INFO at org.bukkit.craftbukkit.v1_12_R1.event.CraftEventFactory.handleEntityDamageEvent( ~[paperspigot.jar:git-Paper-1488]
    13.07 01:54:02 [Server] INFO at org.bukkit.craftbukkit.v1_12_R1.event.CraftEventFactory.callEntityDamageEvent( ~[paperspigot.jar:git-Paper-1488]
    13.07 01:54:02 [Server] INFO at org.bukkit.craftbukkit.v1_12_R1.event.CraftEventFactory.callEvent( ~[paperspigot.jar:git-Paper-1488]
    13.07 01:54:02 [Server] INFO at org.bukkit.plugin.SimplePluginManager.callEvent( ~[paperspigot.jar:git-Paper-1488]
    13.07 01:54:02 [Server] INFO at org.bukkit.plugin.SimplePluginManager.fireEvent( ~[paperspigot.jar:git-Paper-1488]
    13.07 01:54:02 [Server] INFO at org.bukkit.plugin.RegisteredListener.callEvent( ~[paperspigot.jar:git-Paper-1488]
    13.07 01:54:02 [Server] INFO at co.aikar.timings.TimedEventExecutor.execute( ~[paperspigot.jar:git-Paper-1488]
    13.07 01:54:02 [Server] INFO at org.bukkit.plugin.EventExecutor$2.execute( ~[paperspigot.jar:git-Paper-1488]
    13.07 01:54:02 [Server] INFO at com.destroystokyo.paper.event.executor.asm.generated.GeneratedEventExecutor44.execute(Unknown Source) ~[?:?]
    13.07 01:54:02 [Server] INFO at ~[?:?]
    13.07 01:54:02 [Server] INFO java.lang.NoClassDefFoundError: com/seven/core/damage$1 13.07 01:54:02 [Server] ERROR Could not pass event EntityDamageByEntityEvent to Seven v1.0
    So I'm getting that stacktrace. Before you say it's paper, this was happening on my Spigot.jar as well.
    Here's the code:
    Code (Text):

    @EventHandler (priority = EventPriority.LOWEST)
        public void hitDetection(EntityDamageByEntityEvent event) {
            if (!(event.getEntity().isDead())) {
                if (event.getEntity() instanceof LivingEntity) {
                    LivingEntity victim = (LivingEntity) event.getEntity();
                        new BukkitRunnable() {
                            public void run() {
                        }.runTaskLaterAsynchronously(Main, 1L);
    It's been happening only certain times though. I may restart the server and it will happen, other times it's fine, its rather peculiar and I don't see how its causing an error. I've also tried swapping between Async and Sync, no luck. Async performs better so I'm sticking to that.
  2. Your NoClassDefFoundError is similar to my errors relating to Bukkit schedulers still running on plugin disable. And what do you know, you're scheduling an async task. In your onDisable method in your main class, perhaps adding this line will help:
    Code (Text):
  3. Okay, but the plugin isn't disabling till the server ends, is the task persisting past restarts?

    I do use schedulers quite a bit, but it's always referencing a Main scheduler.
  4. Oh, a restart? That's weird. Usually I get that error if something is calling a class that doesn't exist, such as if I'm screwing around with incompatible NMS versions, rebuilding the jar while it's in use, and reloading without killing repeating Bukkit tasks or other threads.

    What's even more strange is that you're making a new non-repeatable task, so I guess my suggestion won't help either.

    I just realized that your stacktrace is probably upside down. (I hate consoles that spit things out the wrong way.) Whats in line 158 in your damage class?
    #4 Islandscout, Jul 13, 2018
    Last edited: Jul 13, 2018
  5. Line 158 should be the bukkitRunnable. I think it has to do with the plugin reference @ Main, which is just a Main getter / constructor.
  6. Bump, this is also happening with like two other runnables, same error, same idea.