OK、私はMinecraft Javaプラグインを作成しています。それは、トリガーされるプリセットサウンドを使用してプレイヤーに曲を再生します:
player.playSound(player.getLocation(), Sound.NOTE_BASS, 2, 10);
そして、ハンマータイムなどの歌詞を歌わせたいので、次のようになります。
Bukkit.broadcastMessage(ChatColor.DARK_PURPLE +"[Server]" +ChatColor.AQUA + "Na Na Na Na, Na Na");
player.playSound(player.getLocation(), Sound.NOTE_BASS, 1, 10);
player.playSound(player.getLocation(), Sound.NOTE_BASS, 2, 10);
player.playSound(player.getLocation(), Sound.NOTE_BASS, 3, 10);
player.playSound(player.getLocation(), Sound.NOTE_BASS, 4, 10);
player.playSound(player.getLocation(), Sound.NOTE_BASS, 1, 10);
//a sleep statement here
など ..... だから私はThread.sleep(100)
orを使いたくwait()
ありません。なぜなら、彼らは私にtry
,catch
ステートメントを使用する必要があるからです脚本。だから私はこれを行う他の方法はありますか?