public abstract class AbstractChatEvent extends PlayerEvent implements Cancellable
Event.Result
player
Modifier and Type | Method and Description |
---|---|
@NotNull ChatComposer |
composer()
Deprecated.
for removal with 1.17, in favour of
renderer() |
void |
composer(@NotNull ChatComposer composer)
Deprecated.
for removal with 1.17, in favour of
renderer(ChatRenderer) |
@NotNull ChatFormatter |
formatter()
Deprecated.
for removal with 1.17, in favour of
renderer() |
void |
formatter(@NotNull ChatFormatter formatter)
Deprecated.
for removal with 1.17, in favour of
renderer(ChatRenderer) |
boolean |
isCancelled()
Gets the cancellation state of this event.
|
@NotNull net.kyori.adventure.text.Component |
message()
Gets the user-supplied message.
|
void |
message(@NotNull net.kyori.adventure.text.Component message)
Sets the user-supplied message.
|
@NotNull net.kyori.adventure.text.Component |
originalMessage()
Gets the original and unmodified user-supplied message.
|
@NotNull Set<Player> |
recipients()
Deprecated.
for removal with 1.17, in favor of
viewers() |
@NotNull ChatRenderer |
renderer()
Gets the chat renderer.
|
void |
renderer(@NotNull ChatRenderer renderer)
Sets the chat renderer.
|
void |
setCancelled(boolean cancelled)
Sets the cancellation state of this event.
|
@NotNull Set<net.kyori.adventure.audience.Audience> |
viewers()
Gets a set of
audiences that this chat message will be displayed to. |
getPlayer
callEvent, getEventName, getHandlers, isAsynchronous
@NotNull public final @NotNull Set<net.kyori.adventure.audience.Audience> viewers()
audiences
that this chat message will be displayed to.
The set returned is not guaranteed to be mutable and may auto-populate on access. Any listener accessing the returned set should be aware that it may reduce performance for a lazy set implementation.
Listeners should be aware that modifying the list may throw UnsupportedOperationException
if the event caller provides an
unmodifiable set.
audiences
who will receive the chat message@Deprecated @NotNull public final @NotNull Set<Player> recipients()
viewers()
The set returned is not guaranteed to be mutable and may auto-populate on access. Any listener accessing the returned set should be aware that it may reduce performance for a lazy set implementation.
Listeners should be aware that modifying the list may throw UnsupportedOperationException
if the event caller provides an
unmodifiable set.
public final void renderer(@NotNull @NotNull ChatRenderer renderer)
renderer
- the chat rendererNullPointerException
- if renderer
is null
@NotNull public final @NotNull ChatRenderer renderer()
@Deprecated @NotNull public final @NotNull ChatComposer composer()
renderer()
@Deprecated public final void composer(@NotNull @NotNull ChatComposer composer)
renderer(ChatRenderer)
composer
- the chat composerNullPointerException
- if composer
is null
@Deprecated @NotNull public final @NotNull ChatFormatter formatter()
renderer()
@Deprecated public final void formatter(@NotNull @NotNull ChatFormatter formatter)
renderer(ChatRenderer)
formatter
- the chat formatterNullPointerException
- if formatter
is null
@NotNull public final @NotNull net.kyori.adventure.text.Component message()
message(Component)
.public final void message(@NotNull @NotNull net.kyori.adventure.text.Component message)
message
- the user-supplied messageNullPointerException
- if message
is null
@NotNull public final @NotNull net.kyori.adventure.text.Component originalMessage()
message(Component)
.public final boolean isCancelled()
Cancellable
isCancelled
in interface Cancellable
public final void setCancelled(boolean cancelled)
Cancellable
setCancelled
in interface Cancellable
cancelled
- true if you wish to cancel this eventCopyright © 2021. All rights reserved.