Hello guys! Today i sit on an FFA Plugin, but the Plugin contains an /spawn command. How can i make it that the player who is fighting don't perform this command?
@SkyleTyler1337 No. He wants a cooldown just like CombatLog, so when someone gets damaged or damages someone else, they can't use /spawn for a bit (Right @EinOttoman ?) What have you tried
@EinOttoman on EntitydamagebyEntity event you check if it's a player attacking a player if so you add them to a HashMap with the players UUID and a long value. The UUID will be the players and the long value will be system current time. Then you do checks to see of the timer is over or not. Then in the command preprocess event check if the command equals to /spawn and if they are still in the cooldown, if so cancel the event.