Interface ComponentTransform
public interface ComponentTransform
-
Method Summary
Modifier and TypeMethodDescriptionstatic ComponentTransform
nested(ComponentTransform transform)
Creates a transform that applies the given transform on all child components and the component itself.static ComponentTransform
stripClicks(net.kyori.adventure.text.event.ClickEvent.Action... actionsToRemove)
Creates a transform that removes click events of the given actions from a component.@NonNull net.kyori.adventure.text.Component
transform(@NonNull net.kyori.adventure.text.Component original)
Applies this transform on the given component and returns the result.
-
Method Details
-
stripClicks
static ComponentTransform stripClicks(net.kyori.adventure.text.event.ClickEvent.Action... actionsToRemove)Creates a transform that removes click events of the given actions from a component. Note: To remove click events from children too, the returned transform must be wrapped usingnested(ComponentTransform)
.- Parameters:
actionsToRemove
- the actions used to filter which click events should be removed.- Returns:
- a new transform that removes click events from a component.
-
transform
@NonNull net.kyori.adventure.text.Component transform(@NonNull net.kyori.adventure.text.Component original)Applies this transform on the given component and returns the result.- Parameters:
original
- the component to transform.- Returns:
- the transformed component.