-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathtext.html
348 lines (346 loc) · 10.8 KB
/
text.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
<h1 id="nav-title">Text in Scripts</h1>
<div id="content-no-docs" class="no-left-panel" style="padding-top: 32px;">
<h2 class="title">Text (String)</h2>
<p class="subtitle">
Skript allows you to write pieces of text (programmers usually call them strings) in the scripts. This is done by putting the text inside double quotes, as follows:
</p>
<div class="box skript-code-block left-margin">"this is text"</div>
<p class="subtitle">
Simple, isn't it? If an effect, expression, condition, trigger or function accepts something of type text or string, you can use this format to write it right there!
</p>
<h2 class="title">Formatting Text</h2>
<p class="subtitle">
But isn't just text a bit boring? Worry not, as Minecraft has support for colors, styles and other formatting options in chat. Most of the options also work with item and entity names.
</p>
<h2 class="title">Colors</h2>
<p class="subtitle">
Minecraft has 16 pre-set color codes to be used in text. Skript supports them in two different ways:
</p>
<p class="box left-margin">
Color name tags, for example <b><red></b><br/> Minecraft color codes, like <b>§c</b>; using <b>&</b> works, too
</p>
<p class="subtitle">
Here's a table of all colors, including both Skript names and color codes:
</p>
<table class="colors-table">
<tr style="font-weight: 700">
<td>Color</td>
<td>Code</td>
<td>Name</td>
<td>Alternative Names</td>
</tr>
<tr>
<td style="
background-color: #000000;
color: #ffffff;
width: 10px;
height: 10px;
"></td>
<td>§0</td>
<td>black</td>
<td></td>
</tr>
<tr>
<td style="
background-color: #0000aa;
color: #ffffff;
width: 10px;
height: 10px;
"></td>
<td>§1</td>
<td>blue</td>
<td>dark blue</td>
</tr>
<tr>
<td style="
background-color: #00aa00;
color: #ffffff;
width: 10px;
height: 10px;
"></td>
<td>§2</td>
<td>green</td>
<td>dark green</td>
</tr>
<tr>
<td style="
background-color: #00aaaa;
color: #ffffff;
width: 10px;
height: 10px;
"></td>
<td>§3</td>
<td>cyan</td>
<td>aqua, dark cyan, dark aqua, dark turquoise, dark turquois</td>
</tr>
<tr>
<td style="
background-color: #aa0000;
color: #ffffff;
width: 10px;
height: 10px;
"></td>
<td>§4</td>
<td>red</td>
<td>dark red</td>
</tr>
<tr>
<td style="
background-color: #aa00aa;
color: #ffffff;
width: 10px;
height: 10px;
"></td>
<td>§5</td>
<td>purple</td>
<td>dark purple</td>
</tr>
<tr>
<td style="
background-color: #ffaa00;
color: #000000;
width: 10px;
height: 10px;
"></td>
<td>§6</td>
<td>orange</td>
<td>orange, gold, dark yellow</td>
</tr>
<tr>
<td style="
background-color: #aaaaaa;
color: #000000;
width: 10px;
height: 10px;
"></td>
<td>§7</td>
<td>grey</td>
<td>light grey, gray, light gray, silver</td>
</tr>
<tr>
<td style="
background-color: #555555;
color: #ffffff;
width: 10px;
height: 10px;
"></td>
<td>§8</td>
<td>dark gray</td>
<td>dark grey</td>
</tr>
<tr>
<td style="
background-color: #5555ff;
color: #ffffff;
width: 10px;
height: 10px;
"></td>
<td>§9</td>
<td>light blue</td>
<td>light blue, indigo</td>
</tr>
<tr>
<td style="
background-color: #55ff55;
color: #000000;
width: 10px;
height: 10px;
"></td>
<td>§a</td>
<td>light green</td>
<td>lime, lime green</td>
</tr>
<tr>
<td style="
background-color: #55ffff;
color: #000000;
width: 10px;
height: 10px;
"></td>
<td>§b</td>
<td>light cyan</td>
<td>light aqua, turquoise, turquois, light blue</td>
</tr>
<tr>
<td style="
background-color: #ff5555;
color: #000000;
width: 10px;
height: 10px;
"></td>
<td>§c</td>
<td>light red</td>
<td>pink</td>
</tr>
<tr>
<td style="
background-color: #ff55ff;
color: #000000;
width: 10px;
height: 10px;
"></td>
<td>§d</td>
<td>magenta</td>
<td>light purple</td>
</tr>
<tr>
<td style="
background-color: #ffff55;
color: #000000;
width: 10px;
height: 10px;
"></td>
<td>§e</td>
<td>yellow</td>
<td>light yellow</td>
</tr>
<tr>
<td style="
background-color: #ffffff;
color: #000000;
width: 10px;
height: 10px;
"></td>
<td>§f</td>
<td>white</td>
<td></td>
</tr>
</table>
<p class="subtitle">
In <b>Minecraft 1.16</b>, support was added for
<b>6-digit</b> hexadecimal colors to specify custom colors other than the 16 default color codes. A new tag can be used to format with these colors. The tag looks like this:
</p>
<div class="box skript-code-block left-margin"><#hex code></div>
<p class="subtitle">Here's what the tag would look like when used in a script:</p>
<div class="box skript-code-block left-margin">
send "<#123456>Hey %player%!" to player
</div>
<p class="subtitle">
For information not related to Skript, see
<a href="https://minecraft.gamepedia.com/Formatting_codes#Color_codes">Minecraft Wiki page</a
>
concerning colors. Note that depending on Skript configuration, color
codes may do more than just change color of text after them. By default,
for backwards compatibility, they clear following styles: magic, bold,
strikethrough, underlined, italic. Other styles are not affected, and
this feature can be toggled of in config.sk.
</p>
<h2 class="title">Other Styles</h2>
<p class="subtitle">
Minecraft also has various other styles available. The following are
available everywhere, including item and entity names:
</p>
<table class="colors-table">
<tr style="font-weight: 700">
<td>Code</td>
<td>Name</td>
<td>Alternative Names</td>
</tr>
<tr>
<td>§k</td>
<td>magic <span class="magic-text" style="position: absolute;">test</span></td>
<td>obfuscated</td>
</tr>
<tr>
<td>§l</td>
<td style="font-weight: bold">bold</td>
<td>b</td>
</tr>
<tr>
<td>§m</td>
<td style="text-decoration: line-through">strikethrough</td>
<td>strike, s</td>
</tr>
<tr>
<td>§n</td>
<td style="text-decoration: underline">underlined</td>
<td>underline, u</td>
</tr>
<tr>
<td>§o</td>
<td style="font-style: italic">italic</td>
<td>italics, i</td>
</tr>
<tr>
<td>§r</td>
<td>reset</td>
<td>r</td>
</tr>
</table>
<p class="subtitle">
If it wasn't clear from the table, §r clears all other formatting and
colors. You'll probably use it quite often when sending chat messages
from scripts.
</p>
<p class="subtitle">
Skript also supports certain newer features, which are only available in
chat. Those do not have formatting codes, so you must use tags for them.
</p>
<table class="colors-table">
<tr style="font-weight: 700">
<td>Name</td>
<td>Alternative Names</td>
<td>Description</td>
</tr>
<tr>
<td>link</td>
<td>open url, url</td>
<td>Opens a link when player clicks on text</td>
</tr>
<tr>
<td>run command</td>
<td>command, cmd</td>
<td>Makes player execute a chat command when they click on text</td>
</tr>
<tr>
<td>suggest command</td>
<td>sgt</td>
<td>Adds a command to chat prompt of player when clicked</td>
</tr>
<tr>
<td>tooltip</td>
<td>show text, ttp</td>
<td>Shows a tooltip when player hovers over text with their mouse</td>
</tr>
<tr>
<td>font</td>
<td>f</td>
<td>Change the font of the text (1.16+)</td>
</tr>
<tr>
<td>insertion</td>
<td>insert, ins</td>
<td>Will append a text at player's current cursor in chat input only while holding SHIFT.</td>
</tr>
</table>
<p class="subtitle">All of these styles require a parameter, in format</p>
<div class="box skript-code-block left-margin">
<name:parameter>
</div>
<p class="subtitle">
For link, parameter must be either http or https url if you want clients
to recognize it. For others, it can be any text you'd like (you can make
player run invalid commands if you wish).
</p>
<h2 class="title">Unicode</h2>
<p>
Skript supports Unicode characters in any text. To add them to your scripts,
simply paste the character inside the text, or use the provided Unicode tag.
The tag uses the character's codepoint to replace it with the actual character
when the text is loaded.
</p>
<div class="box skript-code-block left-margin">
"hello <u:1F41B>" # hello 🐛<br>
"<unicode:03B5> <unicode:2245> <unicode:0194>, right?" # ε ≅ Ɣ, right?
</div>
<h2 class="title">Text and Variables</h2>
<p class="subtitle">
Variable names are text, but obviously formatting that text does no
good. However, everything else you can do for text, you can do for
variable names. A guide about this is coming... some day.
</p>
<p style="padding-bottom: 20px">
Guide written by <a href="https://github.com/bensku">bensku</a>.
</p>
<div style="padding-top: 32px;"></div> <!-- Space -->
</div>