Interface PlayerPostEffects
@NullMarked
public interface PlayerPostEffects
Represents the post-effects that can be applied to a player.
- Since:
- 26.3
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionbooleanadd(net.kyori.adventure.key.Key effect) Adds a post-effect to the player.booleanclear()Clears all post-effects from the player.booleanremove(net.kyori.adventure.key.Key effect) Removes a post-effect from the player.booleanset(SequencedCollection<net.kyori.adventure.key.Key> postEffects) Sets the list of post-effects that are currently applied to the player.voidupdate()Forces an immediate update of post-effects currently applied to the player.@Unmodifiable List<net.kyori.adventure.key.Key> values()Gets the list of post-effects that are currently applied to the player.
-
Method Details
-
values
@Unmodifiable List<net.kyori.adventure.key.Key> values()Gets the list of post-effects that are currently applied to the player.- Returns:
- an unmodifiable list of post-effects
- Since:
- 26.3
-
set
Sets the list of post-effects that are currently applied to the player.- Parameters:
postEffects- the list of post-effects to set- Returns:
- true if the post-effects were changed, false if they were the same
- Since:
- 26.3
-
add
boolean add(net.kyori.adventure.key.Key effect) Adds a post-effect to the player.- Parameters:
effect- the key post-effect to add- Returns:
- true if the post-effect was added, false if it was already present
- Since:
- 26.3
-
remove
boolean remove(net.kyori.adventure.key.Key effect) Removes a post-effect from the player.- Parameters:
effect- the key post-effect to remove- Returns:
- true if the post-effect was removed, false if it was not present
- Since:
- 26.3
-
clear
boolean clear()Clears all post-effects from the player.- Returns:
- true if any post-effects were cleared, false if there were none
- Since:
- 26.3
-
update
void update()Forces an immediate update of post-effects currently applied to the player.Calling this method manually is usually unnecessary, as post-effects are automatically synchronized at the end of the player entity tick. It should only be called if changes need to be synchronized immediately.
- Since:
- 26.3
-