Enum Class MiniMessage.Preset
- All Implemented Interfaces:
Serializable, Comparable<MiniMessage.Preset>, Constable, Consumer<MiniMessage.Builder>
- Enclosing interface:
MiniMessage
public static enum MiniMessage.Preset
extends Enum<MiniMessage.Preset>
implements Consumer<MiniMessage.Builder>
A variety of presets for configuring MiniMessage.
These presets can be used to get a default confuguration for MiniMessage by
using the MiniMessage.miniMessage(Preset) method.
Alternatively, you can get a pre-configured builder based on a preset. This can be used to make your own custom MiniMessage instance whilst still keeping any configuration provided by a preset, such as post-processing. An example of how to do this is provided below.
// Obtain the pre-configured builder.
final MiniMessage.Builder builder = MiniMessage.builder(MiniMessage.Preset.NON_INTERACTABLE);
// Add your own tags or override other settings if needed.
builder.editTags(tags -> {
tags
.resolver(new MyCustomTagResolver())
.resolver(fetchExternalTags());
});
// Then build your MiniMessage instance!
final MiniMessage myMiniMessageInstance = builder.build();
- Since:
- 5.0.0
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class Enum
Enum.EnumDesc<E> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionThe default preset, containing all features of MiniMessage.A preset that disables all non-text component types and only allows formatting text components (i.e., color, shadow, decorations, fonts).A preset that disables all interactive features, such as hover and click events. -
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic MiniMessage.PresetReturns the enum constant of this class with the specified name.static MiniMessage.Preset[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
DEFAULT
The default preset, containing all features of MiniMessage.- Since:
- 5.0.0
-
NON_INTERACTABLE
A preset that disables all interactive features, such as hover and click events.This preset also removes hover and click events from the returned component using a custom post-processor.
- Since:
- 5.0.0
-
FORMATTED_TEXT
A preset that disables all non-text component types and only allows formatting text components (i.e., color, shadow, decorations, fonts).This preset also performs the following modifications to the resulting component using a custom post-processor:
- Removes click events, hover events, and insertions from all text components.
- Filters out any non-text components.
- Since:
- 5.0.0
-
-
Field Details
-
NAMES
The name map.This can be used to easily make configurable presets.
- Since:
- 5.0.0
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum class has no constant with the specified nameNullPointerException- if the argument is null
-