broadcastSound

fun broadcastSound(sound: Sound, volume: Float, pitch: Float, predicate: Predicate<SpigotPlayer> = Predicate { true })

Broadcasts a sound to all players satisfying the given predicate.

This method sends a sound effect to all players that meet the condition specified by the provided predicate. The sound is played at a specified volume and pitch.

Parameters

sound

The sound to be broadcasted to players.

volume

The volume at which the sound is played. Typically ranges from 0.0 to 1.0.

pitch

The pitch of the sound. Higher values produce higher-pitched sounds.

predicate

A function that evaluates whether a player should receive the sound. Defaults to a predicate that includes all players.


fun broadcastSound(sound: Sound, predicate: Predicate<SpigotPlayer> = Predicate { true })

Broadcasts a sound to all players satisfying the given predicate.

This method allows a sound to be played for a group of players based on a specified condition. By default, the sound is broadcasted to all players.

Parameters

sound

The sound to be played.

predicate

A filter function to determine which players should receive the sound. Defaults to a predicate that always returns true.