Minecraft] Ban players temporarily when they die?

Ba
6

I've already written the following:

@SuppressWarnings ( "deprecation")
@EventHandler
public void onDeath (PlayerDeathEvent e) {

Player p = e.getEntity ();

if (p.isDead ()) {
p.kickPlayer ("§7- * - + - * - §8 [§b§lmyLife§8] §7- * - + - * - \ n \ n§eYou died. \ n§cYou are out of the Game §4 eliminated §c! ");

p.setBanned (true);

}

}

Now, unfortunately, I don't know how to temporarily ban a player instead of perma…

Pu

There are plugins that do what you can do with commands, and you can include the commands in the code

Ba

I would like to have it in my own code right away. I don't want to download any plugins & then decompile them or something

Ta

If you get a code here, you will forget it anyway. Just look there, or google

Ba

I don't need any config to indicate that someone is banned or not -.

an

You need a file that shows how long each player is banned (or when the ban is over). Google what kind of file is best for it, and then program it. When banning a player, you then enter the date / time in the file when he should be released. Then you need an event that always updates and releases the players if necessary. If Banned_Until

Lo

Ban temporarily

Save time when banned (System.getCurrentMillis ())
Ban players
When the player tries to join, ask if time has been met
If so, release