What I want to do is quite simple. I have my own custom resource pack with custom sounds and I want to play music in specific regions. For the region part im going to use : http://dev.bukkit.org/bukkit-plugins/worldguard-region-events/ For playing the sound part I have no idea how I can play it repeatedly when someone is in a region. I removed the normal juke box sounds and placed the custom sounds I have, so is there a way to play a sound like from a jukebox repeatedly ?
boniomri PHP: Bukkit.getServer().playSound(); You can then use a repeating task to constantly play the sound.
Niknea Then now there are two things you left un answered. When the player leaves the region how can the event stop the sound? And how can the repeating task know when the sound ends to play it again.
boniomri Question one, create a runnable instead of repeating task, as you can cancel it, listen to when they leave the region, and cancel the runnable. Question two, it won't, time how long it'll take, and set the repeating task to play the sound after that amount of time.