因此,我试图制造一个由Fundy激发的impossibleX难度,并且我试图使它变得这样,当一个球员呼吸时,他会感到虚弱,如下所示,但问题是,它不会将他们的健康降到一半,并在他呼吸后增加慢/弱/挖掘疲劳,但它确实传递了一个信息:“你在呼吸后感到虚弱.”
我能帮忙吗?
public static void nahwouldyounotrespawn(PlayerRespawnEvent e){
Player player = e.getPlayer();
player.sendMessage("You feel weak after respawning...");
player.setHealth(10);
player.addPotionEffect(new PotionEffect(PotionEffectType.SLOW, 30000, 5));
player.addPotionEffect(new PotionEffect(PotionEffectType.WEAKNESS, 30000, 5));
player.addPotionEffect(new PotionEffect(PotionEffectType.SLOW_DIGGING, 30000, 255));
}
发布于 2021-05-12 10:27:36
这是the fourth time,您得到了一个包含关于如何安排任务的信息的答案。我强烈敦促你切实阅读你所收到的文章,因为它们将帮助你。
public void playerRespawnEffects(PlayerRespawnEvent e){
Player player = e.getPlayer();
player.sendMessage("You feel weak after respawning...");
Bukkit.getScheduler().runTaskLater(/*Your plugin instance*/, () -> {
player.setHealth(10);
player.addPotionEffect(new PotionEffect(PotionEffectType.SLOW, 30000, 5));
player.addPotionEffect(new PotionEffect(PotionEffectType.WEAKNESS, 30000, 5));
player.addPotionEffect(new PotionEffect(PotionEffectType.SLOW_DIGGING, 30000, 255));
}, /*Tick delay here e.g. 1L*/);
}
https://stackoverflow.com/questions/67496310
复制相似问题