Interface ForwardingAudience.Single
-
- All Superinterfaces:
Audience,ForwardingAudience,Pointered
- Enclosing interface:
- ForwardingAudience
public static interface ForwardingAudience.Single extends ForwardingAudience
An audience that forwards everything to a single other audience.- Since:
- 4.0.0
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface net.kyori.adventure.audience.ForwardingAudience
ForwardingAudience.Single
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Deprecated Methods Modifier and Type Method Description @NotNull Audienceaudience()Gets the audience.default @NotNull Iterable<? extends Audience>audiences()Deprecated.this audience only supports forwarding to a single audiencedefault voidclearTitle()Clears the title, if one is being displayed.default <T> @NotNull Optional<T>get(@NotNull Pointer<T> pointer)Gets the value ofpointer.default <T> TgetOrDefault(@NotNull Pointer<T> pointer, T defaultValue)Gets the value ofpointer.default <T> @UnknownNullability TgetOrDefaultFrom(@NotNull Pointer<T> pointer, @NotNull Supplier<? extends T> defaultValue)Gets the value ofpointer.default voidhideBossBar(@NotNull BossBar bar)Hides a boss bar.default voidopenBook(@NotNull Book book)Opens a book.default voidplaySound(@NotNull Sound sound)Plays a sound at the location of the recipient of the sound.default voidplaySound(@NotNull Sound sound, double x, double y, double z)Plays a sound at a location.default voidplaySound(@NotNull Sound sound, @NotNull Sound.Emitter emitter)Plays a sound from an emitter, usually an entity.default voidresetTitle()Resets the title and timings back to their default.default voidsendActionBar(@NotNull Component message)Sends a message on the action bar.default voidsendMessage(@NotNull Identified source, @NotNull Component message, @NotNull MessageType type)Sends a chat message.default voidsendMessage(@NotNull Identity source, @NotNull Component message, @NotNull MessageType type)Sends a chat message.default voidsendPlayerListFooter(@NotNull Component footer)Sends the player list footer.default voidsendPlayerListHeader(@NotNull Component header)Sends the player list header.default voidsendPlayerListHeaderAndFooter(@NotNull Component header, @NotNull Component footer)Sends the player list header and footer.default voidshowBossBar(@NotNull BossBar bar)Shows a boss bar.default voidshowTitle(@NotNull Title title)Shows a title.default voidstopSound(@NotNull SoundStop stop)Stops a sound, or many sounds.-
Methods inherited from interface net.kyori.adventure.audience.Audience
openBook, sendActionBar, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendPlayerListFooter, sendPlayerListHeader, sendPlayerListHeaderAndFooter, stopSound
-
-
-
-
Method Detail
-
audience
@OverrideOnly @NotNull @NotNull Audience audience()
Gets the audience.- Returns:
- the audience
- Since:
- 4.0.0
-
audiences
@Deprecated @NotNull default @NotNull Iterable<? extends Audience> audiences()
Deprecated.this audience only supports forwarding to a single audienceGets the audiences.- Specified by:
audiencesin interfaceForwardingAudience- Returns:
audience()
-
get
@NotNull default <T> @NotNull Optional<T> get(@NotNull @NotNull Pointer<T> pointer)
Description copied from interface:PointeredGets the value ofpointer.- Specified by:
getin interfaceForwardingAudience- Specified by:
getin interfacePointered- Type Parameters:
T- the type- Parameters:
pointer- the pointer- Returns:
- the value
-
getOrDefault
@Contract("_, null -> null; _, !null -> !null") @Nullable default <T> T getOrDefault(@NotNull @NotNull Pointer<T> pointer, @Nullable T defaultValue)Description copied from interface:PointeredGets the value ofpointer.If this
Audienceis unable to provide a value forpointer,defaultValuewill be returned.- Specified by:
getOrDefaultin interfaceForwardingAudience- Specified by:
getOrDefaultin interfacePointered- Type Parameters:
T- the type- Parameters:
pointer- the pointerdefaultValue- the default value- Returns:
- the value
-
getOrDefaultFrom
default <T> @UnknownNullability T getOrDefaultFrom(@NotNull @NotNull Pointer<T> pointer, @NotNull @NotNull Supplier<? extends T> defaultValue)Description copied from interface:PointeredGets the value ofpointer.If this
Audienceis unable to provide a value forpointer, the value supplied bydefaultValuewill be returned.- Specified by:
getOrDefaultFromin interfaceForwardingAudience- Specified by:
getOrDefaultFromin interfacePointered- Type Parameters:
T- the type- Parameters:
pointer- the pointerdefaultValue- the default value supplier- Returns:
- the value
-
sendMessage
default void sendMessage(@NotNull @NotNull Identified source, @NotNull @NotNull Component message, @NotNull @NotNull MessageType type)Description copied from interface:AudienceSends a chat message.- Specified by:
sendMessagein interfaceAudience- Specified by:
sendMessagein interfaceForwardingAudience- Parameters:
source- the source of the messagemessage- a messagetype- the type- See Also:
Component
-
sendMessage
default void sendMessage(@NotNull @NotNull Identity source, @NotNull @NotNull Component message, @NotNull @NotNull MessageType type)Description copied from interface:AudienceSends a chat message.- Specified by:
sendMessagein interfaceAudience- Specified by:
sendMessagein interfaceForwardingAudience- Parameters:
source- the identity of the source of the messagemessage- a messagetype- the type- See Also:
Component
-
sendActionBar
default void sendActionBar(@NotNull @NotNull Component message)Description copied from interface:AudienceSends a message on the action bar.- Specified by:
sendActionBarin interfaceAudience- Specified by:
sendActionBarin interfaceForwardingAudience- Parameters:
message- a message- See Also:
Component
-
sendPlayerListHeader
default void sendPlayerListHeader(@NotNull @NotNull Component header)Description copied from interface:AudienceSends the player list header.Depending on the implementation of this
Audience, an existing footer may be displayed. If you wish to set both the header and the footer, please useAudience.sendPlayerListHeaderAndFooter(Component, Component).- Specified by:
sendPlayerListHeaderin interfaceAudience- Specified by:
sendPlayerListHeaderin interfaceForwardingAudience- Parameters:
header- the header
-
sendPlayerListFooter
default void sendPlayerListFooter(@NotNull @NotNull Component footer)Description copied from interface:AudienceSends the player list footer.Depending on the implementation of this
Audience, an existing footer may be displayed. If you wish to set both the header and the footer, please useAudience.sendPlayerListHeaderAndFooter(Component, Component).- Specified by:
sendPlayerListFooterin interfaceAudience- Specified by:
sendPlayerListFooterin interfaceForwardingAudience- Parameters:
footer- the footer
-
sendPlayerListHeaderAndFooter
default void sendPlayerListHeaderAndFooter(@NotNull @NotNull Component header, @NotNull @NotNull Component footer)Description copied from interface:AudienceSends the player list header and footer.- Specified by:
sendPlayerListHeaderAndFooterin interfaceAudience- Specified by:
sendPlayerListHeaderAndFooterin interfaceForwardingAudience- Parameters:
header- the headerfooter- the footer
-
showTitle
default void showTitle(@NotNull @NotNull Title title)Description copied from interface:AudienceShows a title.- Specified by:
showTitlein interfaceAudience- Specified by:
showTitlein interfaceForwardingAudience- Parameters:
title- a title- See Also:
Title
-
clearTitle
default void clearTitle()
Description copied from interface:AudienceClears the title, if one is being displayed.- Specified by:
clearTitlein interfaceAudience- Specified by:
clearTitlein interfaceForwardingAudience- See Also:
Title
-
resetTitle
default void resetTitle()
Description copied from interface:AudienceResets the title and timings back to their default.- Specified by:
resetTitlein interfaceAudience- Specified by:
resetTitlein interfaceForwardingAudience- See Also:
Title
-
showBossBar
default void showBossBar(@NotNull @NotNull BossBar bar)Description copied from interface:AudienceShows a boss bar.- Specified by:
showBossBarin interfaceAudience- Specified by:
showBossBarin interfaceForwardingAudience- Parameters:
bar- a boss bar- See Also:
BossBar
-
hideBossBar
default void hideBossBar(@NotNull @NotNull BossBar bar)Description copied from interface:AudienceHides a boss bar.- Specified by:
hideBossBarin interfaceAudience- Specified by:
hideBossBarin interfaceForwardingAudience- Parameters:
bar- a boss bar- See Also:
BossBar
-
playSound
default void playSound(@NotNull @NotNull Sound sound)Description copied from interface:AudiencePlays a sound at the location of the recipient of the sound.To play a sound that follows the recipient, use
Audience.playSound(Sound, Sound.Emitter)withSound.Emitter.self().- Specified by:
playSoundin interfaceAudience- Specified by:
playSoundin interfaceForwardingAudience- Parameters:
sound- a sound- See Also:
Sound
-
playSound
default void playSound(@NotNull @NotNull Sound sound, double x, double y, double z)Description copied from interface:AudiencePlays a sound at a location.- Specified by:
playSoundin interfaceAudience- Specified by:
playSoundin interfaceForwardingAudience- Parameters:
sound- a soundx- x coordinatey- y coordinatez- z coordinate- See Also:
Sound
-
playSound
default void playSound(@NotNull @NotNull Sound sound, @NotNull Sound.Emitter emitter)Description copied from interface:AudiencePlays a sound from an emitter, usually an entity.Sounds played using this method will follow the emitter unless the sound is a custom sound. In this case the sound will be played at the location of the emitter and will not follow them.
To play a sound that follows the recipient, use
Sound.Emitter.self().Note: Due to MC-138832, the volume and pitch may be ignored when using this method.
- Specified by:
playSoundin interfaceAudience- Specified by:
playSoundin interfaceForwardingAudience- Parameters:
sound- a soundemitter- an emitter
-
stopSound
default void stopSound(@NotNull @NotNull SoundStop stop)Description copied from interface:AudienceStops a sound, or many sounds.- Specified by:
stopSoundin interfaceAudience- Specified by:
stopSoundin interfaceForwardingAudience- Parameters:
stop- a sound stop- See Also:
SoundStop
-
openBook
default void openBook(@NotNull @NotNull Book book)Description copied from interface:AudienceOpens a book.When possible, no item should persist after closing the book.
- Specified by:
openBookin interfaceAudience- Specified by:
openBookin interfaceForwardingAudience- Parameters:
book- a book- See Also:
Book
-
-