broadcastAction
Broadcasts an action to a collection of players based on a specified condition.
This method iterates through players meeting the given predicate and applies the provided action to each player. It allows selective execution of actions based on the predicate's evaluation.
Parameters
predicate
A function that evaluates each player to determine if the action should be applied. Defaults to a predicate that always returns true.
action
A function representing the action to be executed for each player meeting the predicate's condition.