#706: Add playSound with Entity as source

By: Gero <gecam59@gmail.com>
This commit is contained in:
Bukkit/Spigot
2022-01-11 18:53:34 +11:00
parent 9003a55038
commit 5dd0f2a5b6
2 changed files with 51 additions and 1 deletions

View File

@@ -349,6 +349,31 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
*/
public void playSound(@NotNull Location location, @NotNull String sound, @NotNull SoundCategory category, float volume, float pitch);
/**
* Play a sound for a player at the location of the entity.
* <p>
* This function will fail silently if Entity or Sound are null.
*
* @param entity The entity to play the sound
* @param sound The sound to play
* @param volume The volume of the sound
* @param pitch The pitch of the sound
*/
public void playSound(@NotNull Entity entity, @NotNull Sound sound, float volume, float pitch);
/**
* Play a sound for a player at the location of the entity.
* <p>
* This function will fail silently if Entity or Sound are null.
*
* @param entity The entity to play the sound
* @param sound The sound to play
* @param category The category of the sound
* @param volume The volume of the sound
* @param pitch The pitch of the sound
*/
public void playSound(@NotNull Entity entity, @NotNull Sound sound, @NotNull SoundCategory category, float volume, float pitch);
/**
* Stop the specified sound from playing.
*