AntiLog plugin bug.

Discussion in 'Spigot Plugin Help' started by 2xjtn, Jan 19, 2020.

  1. Hello! I am a lightweight developer working on a plugin for a server I do some development work on. I am currently creating a plugin that works just like CombatLog. Basically, when a player hits a player, the player player cannot log out, unless they wait an amount of time without fighting anyone. Everything works fine, but there is one problem.

    When a player is fighting another player, I have it set so that it creates a BukkitRunnable if the player is in combat. If the BukkitRunnable delay gets to 0, and the player is still fighting, it sends them both a message that tells them they are out of combat "You are no longer in combat, you may logout!" and both players are removed from the ArrayList. The moment one of them starts hitting the other player, it instantly add the players back into the ArrayList with another message. The problem is that the player is being spammed with these messages while in pvp.

    Is there any way to block it, and reset the BukkitRunnable back to 20 seconds (the cooldown time) ? This would be very helpful, and any help will be greatly appreciated!
  2. Hello please send log on start the server
  3. You need to create 2 bukkit runnable, one for each player independently.