change blocks on revive
All checks were successful
continuous-integration/drone/tag Build is passing
All checks were successful
continuous-integration/drone/tag Build is passing
This commit is contained in:
parent
f0e8ee791a
commit
d79d139cae
@ -92,13 +92,21 @@ public class RevivePlayer{
|
||||
private void revivePlayer(Player player, Location headLocation){
|
||||
// Break blocks
|
||||
headLocation.getBlock().setType(Material.AIR);
|
||||
headLocation.add(new Vector(0,-1,0)).getBlock().setType(Material.AIR);
|
||||
headLocation.add(new Vector(0,-1,0)).getBlock().setType(Material.AIR);
|
||||
headLocation.clone().add(0,-1,0).getBlock().setType(Material.AIR);
|
||||
|
||||
for (int x = -1; x < 2; x++) {
|
||||
for (int y = -1; y < 2; y++) {
|
||||
headLocation.clone().add(x,-2,y).getBlock().setType(Material.ANDESITE);
|
||||
}
|
||||
}
|
||||
|
||||
// Teleport player
|
||||
player.teleport(headLocation);
|
||||
|
||||
// Set player gamemode
|
||||
player.setGameMode(GameMode.SURVIVAL);
|
||||
|
||||
// Set player to 1 heart
|
||||
player.setHealth(2);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user