File tree 1 file changed +15
-0
lines changed
docs/paper/dev/api/component-api
1 file changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -86,6 +86,21 @@ final Component component = MiniMessage.miniMessage().deserialize(
86
86
" applied to all children.\n <u><!b>This is the first child, " +
87
87
" which is rendered after the parent</!b></u><key:key.inventory></b></#438df2>"
88
88
);
89
+
90
+
91
+ // if the syntax above is too verbose for you, create a helper method!
92
+
93
+ public final class Components {
94
+ public static Component mm (String miniMessageString ) { // mm, short for MiniMessage
95
+ return MiniMessage . miniMessage(). deserialize(miniMessageString);
96
+ }
97
+ }
98
+
99
+ // ...
100
+
101
+ import static io.papermc.docs.util.Components.mm ; // replace with your own package
102
+
103
+ final Component component = mm(" <blue>Hello <red>World!" );
89
104
```
90
105
91
106
We recommend using this format for user-facing input such as commands or configuration values.
You can’t perform that action at this time.
0 commit comments