Interface SoundPlayer
public interface SoundPlayer
Plays sounds to players with permission checking.
Usage example:
SoundPlayer soundPlayer = flectonePulse.get(SoundPlayer.class);
Sound sound = ...;
PermissionSetting permission = new PermissionSetting("myplugin.sound", false);
// Play sound to specific player
soundPlayer.play(Pair.of(sound, permission), sender, receiver);
// Play sound at location to nearby players
soundPlayer.play(Pair.of(sound, permission), sender, new Vector3i(100, 64, 200));
- Since:
- 1.6.0
-
Method Summary
Modifier and TypeMethodDescriptiondefault voidplay(Pair<Sound, PermissionSetting> soundPermission, FEntity sender) Plays a sound to a player at their own location.voidPlays a sound from one player to another player.
-
Method Details
-
play
Plays a sound to a player at their own location.- Parameters:
soundPermission- pair containing sound settings and required permissionsender- the entity triggering the sound (checks permission)
-
play
Plays a sound from one player to another player.- Parameters:
soundPermission- pair containing sound settings and required permissionsender- the player triggering the sound (checks permission)receiver- the player receiving the sound
-