Class Audiences

java.lang.Object
net.minestom.server.adventure.audience.Audiences

public class Audiences extends Object
Utility class to access Adventure audiences.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static @NotNull net.kyori.adventure.audience.Audience
    all()
    Gets all audience members.
    static @NotNull net.kyori.adventure.audience.Audience
    all(@NotNull Predicate<net.kyori.adventure.audience.Audience> filter)
    Gets all audience members that match the given predicate.
    static @NotNull net.kyori.adventure.audience.Audience
    Gets the console as an audience.
    static @NotNull net.kyori.adventure.audience.Audience
    custom(@NotNull net.kyori.adventure.key.Key key)
    Gets all custom audience members stored using the given key.
    static @NotNull net.kyori.adventure.audience.Audience
    custom(@NotNull net.kyori.adventure.key.Keyed keyed)
    Gets all custom audience members stored using the given keyed object.
    static @NotNull net.kyori.adventure.audience.Audience
    custom(@NotNull net.kyori.adventure.key.Keyed keyed, Predicate<net.kyori.adventure.audience.Audience> filter)
    Gets all custom audience members stored using the given keyed object that match the given predicate.
    static @NotNull net.kyori.adventure.audience.Audience
    custom(@NotNull net.kyori.adventure.key.Key key, Predicate<net.kyori.adventure.audience.Audience> filter)
    Gets all custom audience members stored using the given key that match the given predicate.
    static @NotNull net.kyori.adventure.audience.Audience
    Gets all custom audience members.
    static @NotNull net.kyori.adventure.audience.Audience
    customs(@NotNull Predicate<net.kyori.adventure.audience.Audience> filter)
    Gets all custom audience members matching the given predicate.
    static @NotNull AudienceProvider<Iterable<? extends net.kyori.adventure.audience.Audience>>
    Gets the AudienceProvider that provides iterables of audience members.
    static @NotNull net.kyori.adventure.audience.Audience
    Gets all audience members that are of type Player.
    static @NotNull net.kyori.adventure.audience.Audience
    players(@NotNull Predicate<Player> filter)
    Gets all audience members that are of type Player and match the predicate.
    static @NotNull AudienceRegistry
    Gets the audience registry used to register custom audiences.
    static @NotNull net.kyori.adventure.audience.Audience
    Gets the combination of players() and console().
    static @NotNull AudienceProvider<net.kyori.adventure.audience.Audience>
    Gets the AudienceProvider that provides forwarding audiences.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • Audiences

      public Audiences()
  • Method Details

    • single

      @NotNull public static @NotNull AudienceProvider<net.kyori.adventure.audience.Audience> single()
      Gets the AudienceProvider that provides forwarding audiences.
      Returns:
      the instance
    • iterable

      @NotNull public static @NotNull AudienceProvider<Iterable<? extends net.kyori.adventure.audience.Audience>> iterable()
      Gets the AudienceProvider that provides iterables of audience members.
      Returns:
      the instance
    • all

      @NotNull public static @NotNull net.kyori.adventure.audience.Audience all()
      Gets all audience members. This returns players() combined with customs() and console(). This can be a costly operation, so it is often preferable to use server() instead.
      Returns:
      all audience members
    • players

      @NotNull public static @NotNull net.kyori.adventure.audience.Audience players()
      Gets all audience members that are of type Player.
      Returns:
      all players
    • players

      @NotNull public static @NotNull net.kyori.adventure.audience.Audience players(@NotNull @NotNull Predicate<Player> filter)
      Gets all audience members that are of type Player and match the predicate.
      Parameters:
      filter - the predicate
      Returns:
      all players matching the predicate
    • console

      @NotNull public static @NotNull net.kyori.adventure.audience.Audience console()
      Gets the console as an audience.
      Returns:
      the console
    • server

      @NotNull public static @NotNull net.kyori.adventure.audience.Audience server()
      Gets the combination of players() and console().
      Returns:
      the audience of all players and the console
    • customs

      @NotNull public static @NotNull net.kyori.adventure.audience.Audience customs()
      Gets all custom audience members.
      Returns:
      all custom audience members
    • custom

      @NotNull public static @NotNull net.kyori.adventure.audience.Audience custom(@NotNull @NotNull net.kyori.adventure.key.Keyed keyed)
      Gets all custom audience members stored using the given keyed object.
      Parameters:
      keyed - the keyed object
      Returns:
      all custom audience members stored using the key of the object
    • custom

      @NotNull public static @NotNull net.kyori.adventure.audience.Audience custom(@NotNull @NotNull net.kyori.adventure.key.Key key)
      Gets all custom audience members stored using the given key.
      Parameters:
      key - the key
      Returns:
      all custom audience members stored using the key
    • custom

      @NotNull public static @NotNull net.kyori.adventure.audience.Audience custom(@NotNull @NotNull net.kyori.adventure.key.Keyed keyed, Predicate<net.kyori.adventure.audience.Audience> filter)
      Gets all custom audience members stored using the given keyed object that match the given predicate.
      Parameters:
      keyed - the keyed object
      filter - the predicate
      Returns:
      all custom audience members stored using the key
    • custom

      @NotNull public static @NotNull net.kyori.adventure.audience.Audience custom(@NotNull @NotNull net.kyori.adventure.key.Key key, Predicate<net.kyori.adventure.audience.Audience> filter)
      Gets all custom audience members stored using the given key that match the given predicate.
      Parameters:
      key - the key
      filter - the predicate
      Returns:
      all custom audience members stored using the key
    • customs

      @NotNull public static @NotNull net.kyori.adventure.audience.Audience customs(@NotNull @NotNull Predicate<net.kyori.adventure.audience.Audience> filter)
      Gets all custom audience members matching the given predicate.
      Parameters:
      filter - the predicate
      Returns:
      all matching custom audience members
    • all

      @NotNull public static @NotNull net.kyori.adventure.audience.Audience all(@NotNull @NotNull Predicate<net.kyori.adventure.audience.Audience> filter)
      Gets all audience members that match the given predicate.
      Parameters:
      filter - the predicate
      Returns:
      all matching audience members
    • registry

      @NotNull public static @NotNull AudienceRegistry registry()
      Gets the audience registry used to register custom audiences.
      Returns:
      the registry