package jp.jias.bukkit.bossmonster; import org.bukkit.Effect; import org.bukkit.Sound; import org.bukkit.entity.Creature; import org.bukkit.scheduler.BukkitRunnable; /** * ボスモンスターにエフェクトをつける * @author i_shi_ba_shi ( jias.jp ) */ public class BossEffect extends BukkitRunnable{ /** * ボスモンスター */ private Creature boss=null; /** * コンストラクタ * @param boss ボスモンスター */ public BossEffect(Creature boss){ this.boss=boss; } @Override public void run(){ // ボスが死んでいるか if(boss.isDead()){ // ループ終了 cancel(); return; } // 1/3の確率で、ボスのいる場所にスポーンブロックの炎のエフェクトを出す if(BossMonster.getRandom().nextInt(3) == 0){ boss.getWorld().playEffect(boss.getLocation(),Effect.MOBSPAWNER_FLAMES,0); } // 1/10の確率で、効果音としてブレイズの吐息を再生速度50%で再生する if(BossMonster.getRandom().nextInt(10) == 0){ boss.getWorld().playSound(boss.getLocation(),Sound.BLAZE_BREATH,100,0.5f); } } }