So, I am running a minigames plugin on my server (not my plugin) and have ctf as one of my minigames. As per player request, they suggested adding respawn delays to the game. Now, I tried coding this by using the PlayerRespawnEvent and making it so they are invisible, blinded and can't move. However, there was about a second to 2 seconds before it actually kicked it when you respawned, even when there was absolutely no lag and on a test server, that had nothing else on it. So, I'm wondering, would it be better to use the PlayerDeathEvent and just add a delay to a player dying? Only concern I have with that is that the minigame plugin has all of its listeners set to highest priority, so I really don't know the best way to go about this here.
@shades161 You can lower the priority of the listeners in your minigame. I would say the easiest way to add the delay would be to create a small box that Players are stuck in until you teleport them out, that would be the easiest I feel (as you could set their spawn point using PlayerRespawnEvent, and this wouldn't lag).
@mythbusterma The minigame plugin isn't mine, and there's no option to lower the listener priority (if there was, I would have done that) but I'll see if I can do something like that
@shades161 How about cancelling the respawn event until the given time? I'm not sure, that's just an idea.
Not 100% sure, but try adding a while loop with the event inside. If it works, set the while loop to false when needed, or keep it to true in the first place.