mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2025-07-20 06:14:44 +02:00
Added the ability for players to "spawn" at their home location, when enabled it moves a player after they have died and revived to their home location.
This commit is contained in:
@ -86,8 +86,14 @@ public class vMinecraftListener extends PluginListener {
|
||||
//Use: Checks for exploits and runs the commands
|
||||
//=====================================================================
|
||||
public boolean onHealthChange(Player player,int oldValue,int newValue){
|
||||
if (player.getHealth() > 1){
|
||||
if (player.getHealth() > 1 && vMinecraftUsers.getProfile(player).isDead()){
|
||||
vMinecraftUsers.getProfile(player).isDead(false);
|
||||
if(vMinecraftSettings.getInstance().playerspawn())
|
||||
{
|
||||
Warp home = null;
|
||||
home = etc.getDataSource().getHome(player.getName());
|
||||
player.teleportTo(home.Location);
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
Reference in New Issue
Block a user