does changing gamemodes work?
This commit is contained in:
parent
e7683204ef
commit
bbac7e1509
6 changed files with 6 additions and 5 deletions
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -39,7 +39,7 @@ public class PlayerListener implements Listener {
|
||||||
Thread.sleep(5000);
|
Thread.sleep(5000);
|
||||||
} catch (InterruptedException interruptedException) {
|
} catch (InterruptedException interruptedException) {
|
||||||
interruptedException.printStackTrace();
|
interruptedException.printStackTrace();
|
||||||
p.sendMessage("Failed to make the thread sleep!");
|
p.sendMessage("[Resurrection] An error has occurred! Please contact the admin. (Failed to make the thread sleep!)");
|
||||||
}
|
}
|
||||||
ResurrectPlayer resurrectPlayer = new ResurrectPlayer(p);
|
ResurrectPlayer resurrectPlayer = new ResurrectPlayer(p);
|
||||||
}).start();
|
}).start();
|
||||||
|
@ -53,14 +53,14 @@ public class PlayerListener implements Listener {
|
||||||
new BukkitRunnable() {
|
new BukkitRunnable() {
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
PotionEffect invisibility = new PotionEffect(PotionEffectType.INVISIBILITY, 200, 10, false);
|
PotionEffect invisibility = new PotionEffect(PotionEffectType.INVISIBILITY, 100, 10, false);
|
||||||
PotionEffect blindness = new PotionEffect(PotionEffectType.BLINDNESS, 200, 10, false);
|
PotionEffect blindness = new PotionEffect(PotionEffectType.BLINDNESS, 100, 10, false);
|
||||||
PotionEffect slowness = new PotionEffect(PotionEffectType.SLOW, 200, 10, false);
|
PotionEffect slowness = new PotionEffect(PotionEffectType.SLOW, 100, 10, false);
|
||||||
invisibility.apply(p);
|
invisibility.apply(p);
|
||||||
blindness.apply(p);
|
blindness.apply(p);
|
||||||
slowness.apply(p);
|
slowness.apply(p);
|
||||||
}
|
}
|
||||||
}.runTaskLater(JavaPlugin.getProvidingPlugin(Resurrection.class), 20);
|
}.runTaskLater(JavaPlugin.getProvidingPlugin(Resurrection.class), 1);
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,6 +8,7 @@ import org.bukkit.potion.PotionEffect;
|
||||||
public class ResurrectPlayer {
|
public class ResurrectPlayer {
|
||||||
|
|
||||||
public ResurrectPlayer(Player p) {
|
public ResurrectPlayer(Player p) {
|
||||||
|
p.setGameMode(GameMode.SURVIVAL);
|
||||||
Bukkit.broadcastMessage(p.getDisplayName() + " has resurrected!");
|
Bukkit.broadcastMessage(p.getDisplayName() + " has resurrected!");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue