RegistrablePlaceholder

@Since(version = "2.2")
interface RegistrablePlaceholder : Registrable

This interface is used to create placeholders.

Properties

Link copied to clipboard
@Since(version = "2.2")
abstract val aliases: List<String>

The aliases for this registrable.

Functions

Link copied to clipboard
@Since(version = "2.2")
abstract fun replacedText(event: Event, trigger: RegistrableTrigger, target: TargetType, args: Map<String, String>): String?

Returns the string that should replace the placeholder. The implementation of this method should be done so that if some failure occurs while creating a replacement for the placeholder, the method should return null. For example, for a placeholder that returns the amount of money that a player has, if no economy provider is present, the method will return null, otherwise it will return the stringified amount of money. event, trigger and target are used to determine the context of the placeholder, while args are the arguments passed to the placeholder, if any.