本文整理汇总了Java中org.bukkit.entity.Player.addPotionEffects方法的典型用法代码示例。如果您正苦于以下问题:Java Player.addPotionEffects方法的具体用法?Java Player.addPotionEffects怎么用?Java Player.addPotionEffects使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.bukkit.entity.Player
的用法示例。
在下文中一共展示了Player.addPotionEffects方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: infect
import org.bukkit.entity.Player; //导入方法依赖的package包/类
public void infect(Player player) {
player.getWorld().strikeLightningEffect(player.getLocation());
teamManager.joinTeam(TGM.get().getPlayerManager().getPlayerContext(player), teamManager.getTeamById("infected"));
if (teamManager.getTeamById("humans").getMembers().size() > 0) player.sendMessage(ChatColor.translateAlternateColorCodes('&', "&c&lYou have been infected!"));
player.addPotionEffects(Collections.singleton(new PotionEffect(PotionEffectType.JUMP, 50000, 1, true, false)));
}
示例2: freeze
import org.bukkit.entity.Player; //导入方法依赖的package包/类
public void freeze(Player player) {
player.addPotionEffects(Arrays.asList(
new PotionEffect(PotionEffectType.SLOW, 10 * 20, 255, true, false),
new PotionEffect(PotionEffectType.JUMP, 10 * 20, 128, true, false),
new PotionEffect(PotionEffectType.BLINDNESS, 10 * 20, 255, true, false)
));
Bukkit.getScheduler().runTaskLater(TGM.get(), () -> unfreeze(player), 10 * 20);
}