blob: 8a5762470c164b82dc735c7d6e04a44473ff6f08 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
|
package net.brysonsteck;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.entity.PlayerDeathEvent;
public class PlayerListener implements Listener {
@EventHandler
public void onDeath(PlayerDeathEvent e) {
Player p = e.getEntity();
Long timeOfDeath = System.currentTimeMillis();
Long resurrectionTime = timeOfDeath + 86400000;
p.sendMessage("You have died at " + timeOfDeath + ". You will respawn at " + resurrectionTime);
}
}
|