2022-10-30 04:33:51 +01:00
|
|
|
# Minstrel
|
|
|
|
|
|
|
|
This plugin aims to add a Minstrel trait to Citizens NPCs which is able to play a set of songs from a custom resource
|
|
|
|
pack. While there are plugins which use workarounds, this plugin aims to make the best npc-based "music box" add-on one
|
|
|
|
can create within the Spigot API. While kind of hard to set up, this allows using any music, without compromise. Note:
|
|
|
|
To make music hear-able only within the area of an NPC, you must make sure the track is Mono (1 channel). If you use a
|
|
|
|
Stereo (2 channels) soundtrack, you'll hear the music everywhere, which is cool if you want to stream music globally.
|
|
|
|
|
|
|
|
Volume between 0 and 1 decides how loud the volume is. If volume is set above 1, it will still play at full volume, but
|
|
|
|
can be heard further away.
|
|
|
|
|
|
|
|
## Dependencies
|
|
|
|
|
2022-10-30 21:11:28 +01:00
|
|
|
- Citizens
|
|
|
|
|
|
|
|
## Important to note
|
|
|
|
|
|
|
|
There are limitations connected to directly playing media using playSound:
|
|
|
|
|
|
|
|
- There is no way to really know what is playing for a player. The best one can do is track any time a song is played
|
|
|
|
outside the global cycle.
|
|
|
|
- When a new player joins there are only two ways to make the music play for the player: Either play immediately, and
|
|
|
|
cut the song short once the playlist switches songs, or play nothing until the playlist switches songs. None of these
|
|
|
|
are ideal.
|
|
|
|
- Songs are really only identified by the category and the song id. Stopping the song for one minstrel will also stop
|
|
|
|
the song if played by any other minstrels at the same time. As songs are only stopped if a song has been played for a
|
|
|
|
player outside the global cycle, it shouldn't be too much of a problem, but if several minstrels play the same song,
|
|
|
|
there may be silent minstrels until the next song plays.
|