Paste #23827: Berufeng's Holograms Script

Date: 2015/12/14 19:55:11 UTC-08:00
Type: Denizen Script

View Raw Paste Download This Paste
Copy Link


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
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656


HologramSymbolProcedure:
    type: procedure
    script:
        - determine <def[1].replace[<&lb>x<&rb>].with[<&chr[2588]>].replace[<&lb>/<&rb>].with[<&chr[258C]>].replace[<&lb><&dot><&rb>].with[<&chr[2591]>].replace[<&lb><&dot><&dot><&rb>].with[<&chr[2592]>].replace[<&lb><&dot><&dot><&dot><&rb>].with[<&chr[2593]>].replace[<&lb>p<&rb>].with[<&chr[2022]>].replace[<&lb><&pipe><&rb>].with[<&chr[2389]>].replace[<&lb>hrt<&rb>].with[<&hrt>]>


SelectedHologramReset:
    type: world
    events:
        on player quits:
            - flag <player> selectedhologram:!


HologramInvulnerability:
    type: world
    events:
        on player right clicks at ARMOR_STAND:
            - if <context.entity.has_flag[is_invulnerable]> determine cancelled
        on entity damages ARMOR_STAND:
            - if <context.entity.has_flag[is_invulnerable]> determine cancelled


Holograms_Help:
    type: task
    help:
        - narrate "<&3>Let's not get silly."
        - queue clear
    script:
        - choose <def[arg2]>:
            - case help:
                - inject s@Holograms_Help path:help
            - case create:
                - inject s@Holograms_Create path:help
            - case new:
                - inject s@Holograms_Create path:help
            - case add:
                - inject s@Holograms_Create path:help
            - case addnew:
                - inject s@Holograms_Create path:help
            - case c:
                - inject s@Holograms_Create path:help
            - case remove:
                - inject s@Holograms_Remove path:help
            - case rem:
                - inject s@Holograms_Remove path:help
            - case r:
                - inject s@Holograms_Remove path:help
            - case delete:
                - inject s@Holograms_Remove path:help
            - case del:
                - inject s@Holograms_Remove path:help
            - case movehere:
                - inject s@Holograms_Movehere path:help
            - case tphere:
                - inject s@Holograms_Movehere path:help
            - case tpto:
                - inject s@Holograms_Tpto path:help
            - case move:
                - inject s@Holograms_Tpto path:help
            - case moveto:
                - inject s@Holograms_Tpto path:help
            - case tp:
                - inject s@Holograms_Tpto path:help
            - case select:
                - inject s@Holograms_Select path:help
            - case sel:
                - inject s@Holograms_Select path:help
            - case s:
                - inject s@Holograms_Select path:help
            - case setline:
                - inject s@Holograms_Setline path:help
            - case set:
                - inject s@Holograms_Setline path:help
            - case addline:
                - inject s@Holograms_Setline path:help
            - case adjust:
                - inject s@Holograms_Setline path:help
            - case edit:
                - inject s@Holograms_Setline path:help
            - default:
                - narrate ""
                - narrate "<&9><&l>----------Holograms Commands----------"
                - narrate ""
                - narrate "<&b>/h create <&lt>hologram_name<&gt>"
                - narrate "<&b>/h remove <&lt>hologram_name<&gt>"
                - narrate "<&b>/h movehere <&lt>hologram_name<&gt>"
                - narrate "<&b>/h move <&lt>hologram_name1<&gt> <&lt>hologram_name2<&gt>"
                - narrate "<&b>/h select <&lt>hologram_name<&gt>"
                - narrate "<&b>/h setline <&lt>hologram_name<&gt> <&lt>#<&gt> <&lt>Your text here<&gt>"
                - narrate "<&b>/h list"
                - narrate ""
                - narrate "<&8>(Hint: Add '<&b>help<&8>' after any of the above commands for more info!)"
                - queue clear


Holograms_Create:
    type: task
    help:
        - narrate ""
        - narrate "<&9><&l>----------Holograms '<&b><&l>Create<&9><&l>' Help----------"
        - narrate ""
        - narrate "<&3>    Used for creating a new hologram. You must specify"
        - narrate "<&3>    the name you wish to give your new hologram."
        - narrate ""
        - narrate "<&9>Aliases: <&b>/h create<&3>, <&b>/h add<&3>, <&b>/h addnew<&3>, or <&b>/h c"
        - narrate "<&9>Usage: <&b>/h create <&lt>hologram_name<&gt> <&8>(here/there/<&lt>hologram<&gt>)"
        - narrate ""
        - narrate "<&3>    Creates a hologram <&8>(optionally: at <&2>your location<&8>,"
        - narrate "<&8>    your <&2>cursor location<&8>, or at the location of <&2><&lt>hologram<&gt><&8>)."
        - narrate ""
    script:
        - if <def[arg2].matches[^[a-zA-Z0-9_-]+$].not> {
            - narrate "<&4>Invalid argument! Hologram names can only include alphanumeric characters, hyphens, and underscores."
            - queue clear
        }
        - if <def[arg2].is[matches].to[number]> {
            - narrate "<&4>Numeric names are not allowed. Please include at least one letter (a-z) in your hologram name."
            - queue clear
        }
        - choose <def[arg3]>:
            - case null:
                - define createlocation <player.location.sub[0.0,1.25,0.0]>
            - case here:
                - define createlocation <player.location.sub[0.0,1.25,0.0]>
            - case there:
                - define createlocation <player.location.cursor_on.sub[-0.5,1.25,-0.5]>
            - default:
                - if <def[arg3].contains[<&cm>]> {
                    - define createlocation <def[arg3].as_location||null>
                    - if <def[createlocation].is[==].to[null]> {
                        - narrate "<&4>Invalid location specified. Correct format:<&nl><&c>    l<&at>x,y,z,world"
                        - queue clear
                    }
                } else if <server.flag[myholograms].contains[<def[arg3]>]||false> {
                    - define createlocation <server.flag[hologram_entities].as_list.filter[flag[holoname].is[==].to[<def[arg3]>]].get[1].location>
                } else {
                    - narrate "<&4>Invalid arguments. Usage:<&nl>/h <def[arg1]||create> <&lt>hologram_name<&gt> (here/there/<&lt>hologram_name<&gt>)<&nl> - /h <def[arg1]||create> help"
                    - queue clear
                }
        - choose <def[arg2]>:
            - case null:
                - narrate "<&4>What do you want to name it? Usage:<&nl> - /h <def[arg1]||create> <&lt>hologram_name<&gt><&nl> - /h <def[arg1]||create> help"
                - queue clear
            - case all:
                - narrate "<&4>Oops! You can't name your hologram '<&b><def[arg2]><&4>'! If you want it to display '<def[arg2]>' you can create it with a different name and then edit the text with /h edit."
                - queue clear
            - default:
                - if <server.flag[myholograms].contains[<def[arg2]>]||false> {
                    - narrate "<&4>A hologram named '<def[arg2]>' already exists."
                    - queue clear
                } else {
                    - narrate "<&3>Created hologram '<&b><def[arg2]><&3>'."
                    - flag server myholograms:->:<def[arg2]>
                    - flag player selectedhologram:<def[arg2]>
                    - spawn ARMOR_STAND[custom_name=<def[arg2]>;custom_name_visibility=true;gravity=false] <def[createlocation]> save:newhologram
                    - invisible <entry[newhologram].spawned_entities.get[1]> state:true
                    - flag <entry[newhologram].spawned_entities.get[1]> is_invulnerable:1
                    - flag <entry[newhologram].spawned_entities.get[1]> holoname:<def[arg2]>
                    - flag server hologram_entities:->:<entry[newhologram].spawned_entities.get[1]>
                    - queue clear
                }


Holograms_Remove:
    type: task
    help:
        - narrate ""
        - narrate "<&9><&l>----------Holograms '<&b><&l>Remove<&9><&l>' Help----------"
        - narrate ""
        - narrate "<&3>    Used for removing holograms. Specify a hologram"
        - narrate "<&3>    or '<&b>all<&3>' to remove ALL existing holograms<&8>*<&3>."
        - narrate ""
        - narrate "<&9>Aliases: <&b>/h remove<&3>, <&b>/h rem<&3>, <&b>/h r<&3>, <&b>/h delete<&3>, or <&b>/h del"
        - narrate "<&9>Usage: <&b>/h remove <&3><&lb><&b><&lt>hologram_name<&gt><&3>/<&b>all<&8>*<&3><&rb>"
        - narrate ""
        - narrate "<&3>    Deletes the specified hologram, or ALL holograms<&8>*<&3>. If no"
        - narrate "<&3>    hologram is specified, defaults to your selected hologram."
        - narrate ""
        - narrate "<&8>  *requires confirmation"
        - narrate ""
    confirmation:
        - if <player.has_flag[holograms_removeall_attempt].not||true> {
            - flag player holograms_removeall_attempt:1
            - narrate ""
            - narrate "<&4><&lb>WARNING:<&rb> Are you SURE you want to remove all <&c><server.flag[hologram_entities].size><&4> holograms?"
            - wait 1s
            - narrate "<&4>Type the command '<&c>/h <def[arg1]> all<&4>' again to confirm."
            - narrate ""
            - queue clear
        } else {
            - flag player holograms_removeall_attempt:!
        }
    script:
        - if <def[arg2].is[==].to[null]> {
            - define removearg <player.flag[selectedhologram]>
        } else {
            - define removearg <def[arg2]>
        }
        - choose <def[removearg]||null>:
            - case all:
                - choose <server.flag[hologram_entities].size>:
                    - case 0:
                        - narrate "<&4>No holograms to remove!"
                        - queue clear
                    - case 1:
                        - inject locally confirmation
                        - narrate "<&3>Removed <&b>1<&3> hologram!"
                    - default:
                        - inject locally confirmation
                        - narrate "<&3>Removed all <&b><server.flag[hologram_entities].size><&3> holograms!"
                - remove <server.flag[hologram_entities].as_list>
                - remove <server.flag[subordinate_holograms].as_list>
                - flag player selectedhologram:!
                - flag server myholograms:!
                - flag server hologram_entities:!
                - flag server subordinate_holograms:!
                - queue clear
            - case null:
                - narrate "<&4>Remove which one? Usage:<&nl> - /h <def[arg1]||remove> <&lt>hologram_name<&gt><&nl> - /h <def[arg1]||remove> help"
            - default:
                - define removinghologram <server.flag[hologram_entities].as_list.filter[flag[holoname].is[==].to[<def[removearg]>]].get[1]>
                - define removingsubordinates <server.flag[subordinate_holograms].as_list.filter[flag[parent].is[==].to[<def[removearg]>]].as_list>
                - if <server.flag[myholograms].contains[<def[removearg]>].not||true> {
                    - narrate "<&4>There is no hologram named '<def[removearg]>'. <&nl>You can create a hologram with '/h create <&lt>hologram_name<&gt>'."
                    - queue clear
                } else {
                    - narrate "<&3>Removed hologram '<&b><def[removearg]><&3>'."
                    - if <def[removearg].is[==].to[<player.flag[selectedhologram]>]||false> {
                        - flag player selectedhologram:!
                    }
                    - flag server myholograms:<-:<def[removearg]>
                    - flag server hologram_entities:<-:<def[removinghologram]>
                    - define removesubordinatelist <server.flag[subordinate_holograms].as_list.exclude[<def[removingsubordinates]>]>
                    - flag server subordinate_holograms:!
                    - flag server subordinate_holograms:|:<def[removesubordinatelist]>
                    - remove <def[removinghologram]>
                    - remove <def[removingsubordinates]>
                    - queue clear
                }

Holograms_Movehere:
    type: task
    help:
        - narrate ""
        - narrate "<&9><&l>----------Holograms '<&b><&l>Movehere<&9><&l>' Help----------"
        - narrate ""
        - narrate "<&3>    Teleports a hologram to your current location. If no"
        - narrate "<&3>    hologram is specified, defaults to your selected hologram."
        - narrate ""
        - narrate "<&9>Aliases: <&b>/h movehere<&3> or <&b>/h tphere"
        - narrate "<&9>Usage: <&b>/h movehere <&8>(<&3><&lt>hologram_name<&gt><&8>)"
        - narrate ""
        - narrate "<&8>See also: the <&3>move<&8> command. Type '<&3>/h move help<&8>'"
        - narrate "<&8>for more info."
        - narrate ""
    script:
        - if <def[arg2].is[==].to[null]||true> {
            - define movearg <player.flag[selectedhologram]>
        } else {
            - define movearg <def[arg2]>
        }
        - choose <def[movearg]||null>:
            - case null:
                - narrate "<&4>Which one do you want to move? Usage:<&nl> - /h <def[arg1]||movehere> <&lt>hologram_name<&gt><&nl> - /h <def[arg1]||movehere> help"
            - default:
                - define movinghologram <server.flag[hologram_entities].as_list.filter[flag[holoname].is[==].to[<def[movearg]>]].get[1]>
                - if <server.flag[myholograms].contains[<def[movearg]>].not||true> {
                    - narrate "<&4>There is no hologram named '<def[movearg]>'. <&nl>You can create a hologram with '/h create <&lt>hologram_name<&gt>'."
                    - queue clear
                } else {
                    - define movingsubordinates <server.flag[subordinate_holograms].as_list.filter[flag[parent].is[==].to[<def[movearg]>]]||null>
                    - narrate "<&3>Moved hologram '<&b><def[movearg]><&3>' to your location."
                    - teleport <def[movinghologram]> <player.location.sub[0.0,1.25,0.0]>
                    - if <def[movingsubordinates].is[==].to[null].not||false> {
                        - foreach <def[movingsubordinates].as_list> {
                            - teleport <def[value]> <player.location.sub[0.0,1.25,0.0].sub[0.0,<def[value].flag[offset]>,0.0]> 
                        }
                    }
                }


Holograms_Tpto:
    type: task
    help:
        - narrate ""
        - narrate "<&9><&l>----------Holograms '<&b><&l>Move<&9><&l>' Help----------"
        - narrate ""
        - narrate "<&3>    Teleports holograms around."
        - narrate ""
        - narrate "<&9>Aliases: <&b>/h move<&3>, <&b>/h moveto<&3>, <&b>/h tpto<&3>, or <&b>/h tp"
        - narrate "<&9>Usage: <&b>/h move <&3><&lt>hologram_name1<&gt> <&3><&lb><&b><&lt>hologram_name2<&gt><&8>/here/there<&3><&rb>"
        - narrate ""
        - narrate "<&3>    Teleports the specified hologram to <&2>another hologram"
        - narrate "<&3>    or to <&2>your location<&3>, or to your <&2>cursor location<&3>."
        - narrate ""
    script:
        - choose <def[arg2]>:
            - case null:
                - narrate "<&4>You didn't specify which holograms! Usage:<&nl> - /h <def[arg1]||move> <&lt>hologram_name1<&gt> <&lt>hologram_name2<&gt>"
                - queue clear
            - default:
                - if <server.flag[myholograms].contains[<def[arg2]>]||false> {
                    - define tp1 <server.flag[hologram_entities].as_list.filter[flag[holoname].is[==].to[<def[arg2]>]].get[1]>
                    - define tptosubordinates <server.flag[subordinate_holograms].as_list.filter[flag[parent].is[==].to[<def[arg2]>]]||null>
                } else {
                    - narrate "<&4>Invalid arguments. There is no hologram named '<def[arg2]>'."
                    - queue clear
                }
        - choose <def[arg3]>:
            - case null:
                - narrate "<&4>You didn't specify a second hologram! Usage:<&nl> - /h <def[arg1]||move> <&lt>hologram_name1<&gt> <&lt>hologram_name2<&gt><&nl> - /h <def[arg1]||move> help"
                - queue clear
            - case there:
                - define tp2 <player.location.cursor_on.sub[-0.5,1.25,-0.5]>
            - default:
                - if <def[arg2].contains[<&cm>]> {
                    - define tp2 <def[arg2].as_location||null>
                    - if <def[tp2].is[==].to[null]||true> {
                        - narrate "<&4>Invalid location specified. Correct format:<&nl><&c>    l<&at>x,y,z,world"
                        - queue clear
                    }
                } else if <server.flag[myholograms].contains[<def[arg3]>]||false> {
                    - define tp2 <server.flag[hologram_entities].as_list.filter[flag[holoname].is[==].to[<def[arg3]>]].get[1].location>
                } else {
                    - narrate "<&4>Invalid arguments. There is no hologram named '<def[arg3]>'."
                    - queue clear
                }
        - teleport <def[tp1]> <def[tp2]>
        - if <def[tptosubordinates].is[==].to[null].not||false> {
            - foreach <def[tptosubordinates].as_list> {
                - teleport <def[value]> <def[tp2].sub[0.0,<def[value].flag[offset]>,0.0]>
            }
        }
        - if <def[arg3].is[==].to[there]||false> {
            - narrate "<&3>Teleported hologram '<&b><def[arg2]><&3>' to your <&b>cursor<&3> location."
        } else {
            - narrate "<&3>Teleported hologram '<&b><def[arg2]><&3>' to hologram '<&b><def[arg3]><&3>'."
        }


Holograms_Select:
    type: task
    help:
        - narrate ""
        - narrate "<&9><&l>----------Holograms '<&b><&l>Select<&9><&l>' Help----------"
        - narrate ""
        - narrate "<&3>    Selects a hologram, to be used as a default in most hologram"
        - narrate "<&3>    commands. When you create a new hologram it is automatically
        - narrate "<&3>    selected."
        - narrate ""
        - narrate "<&9>Aliases: <&b>/h select<&3>, <&b>/h sel<&3>, or <&b>/h s"
        - narrate "<&9>Usage: <&b>/h select <&lt>hologram_name<&gt>"
        - narrate "<&3>   or  <&b>/h select"
        - narrate ""
        - narrate "<&3>    Selects the specified existing hologram, or displays your"
        - narrate "<&3>    currently selected hologram."
        - narrate ""
    script:
        - if <def[arg2].is[==].to[null]||true> {
            - define selectarg <player.flag[selectedhologram]>
            - if <def[selectarg].is[==].to[null].not||false> {
                - narrate "<&3>You have '<&b><def[selectarg]><&3>' selected."
                - queue clear
            }
        } else {
            - define selectarg <def[arg2]>
        }
        - choose <def[selectarg]>:
            - case null:
                - narrate "<&4>You don't have a hologram selected! Usage:<&nl> - /h <def[arg1]||select> <&lt>hologram_name<&gt><&nl> - /h <def[arg1]||select> help"
                - queue clear 
            - default:
                - if <server.flag[myholograms].contains[<def[selectarg]>].not||true> {
                    - narrate "<&4>There is no hologram named '<def[arg2]>'. <&nl>You can create a hologram with '/h create <&lt>hologram_name<&gt>'."
                    - queue clear
                } else {
                    - if <player.flag[selectedhologram].is[==].to[<def[selectarg]>]||false> {
                        - narrate "<&3>You already have that hologram selected!"
                        - queue clear
                    } else {
                        - narrate "<&3>Selected hologram '<&b><def[selectarg]><&3>'."
                        - flag player selectedhologram:<def[selectarg]>
                        - queue clear
                    }
                }


Holograms_List:
    type: task
    help:
        - narrate ""
        - narrate "<&9><&l>----------Holograms '<&b><&l>List<&9><&l>' Help----------"
        - narrate ""
        - narrate "<&3>    Lists all existing holograms. Specify a page number"
        - narrate "<&3>    to display a different page. Defaults to last page."
        - narrate ""
        - narrate "<&9>Usage: <&b>/h list <&8><&lt>#<&gt>"
        - narrate ""
    script:
        - if <def[arg2].is[==].to[help]> {
            - inject locally help
        }
        - if <server.has_flag[myholograms].not||true> {
            - narrate "<&4>You don't have any holograms yet. <&nl>You can create a hologram with '/h create <&lt>hologram_name<&gt>'."
            - queue clear
        }
        - if <def[arg2].is[==].to[null]||false> {
            - define arg2 <server.flag[myholograms].size.div[12].round_up>
        }
        - if <def[arg2].is[matches].to[number].not||true> {
            - narrate "<&4>Invalid arguments. Usage: <&nl> - /h <def[arg1]||list> <&lt>#<&gt>"
            - queue clear
        } else {
            - if <def[arg2]> > <server.flag[myholograms].size.div[12].round_up> {
                - narrate "<&4>There aren't that many pages! Showing last page."
                - define listarg <server.flag[myholograms].size.div[12].round_up>
            } else {
                - define listarg <def[arg2]>
            }
        }
        - define listmin <def[listarg].sub[1].mul[12].add[1].as_int>
        - define listmax <def[listarg].mul[12].as_int>
        - narrate "<&9><&l>----------Hologram List----------"
        - narrate "<&3>      Page <def[listarg]> of <server.flag[myholograms].size.div[12].round_up>"
        - narrate ""
        - narrate "<&b><server.flag[myholograms].get[<def[listmin]>].to[<def[listmax]>].separated_by[<&3>, <&b>]>"
        - if <server.flag[myholograms].size.div[12].round_up> > <def[listarg]> {
            - narrate ""
            - narrate "<&a>Type <&2>'/h list <def[listarg].add[1]>'<&a> for more."
        } else {
            - narrate ""
            - narrate "<&3>...and that's it!"}


Holograms_Setline: 
    type: task
    help:
        - narrate ""
        - narrate "<&9><&l>----------Holograms '<&b><&l>Setline<&9><&l>' Help-----------"
        - narrate ""
        - narrate "<&3>    Sets the text displayed on your holograms. Supports"
        - narrate "<&3>    formatting and color codes, as well as a number of"
        - narrate "<&3>    special characters. You can set a virtually endless"
        - narrate "<&3>    number of lines, but you must add them one at a time."
        - narrate ""
        - narrate "<&9>Aliases: <&b>/h setline<&3>, <&b>/h addline<&3>, <&b>/h set<&3>, <&b>/h adjust<&3>, or <&b>/h edit"
        - narrate "<&9>Usage: <&b>/h setline <&lt>hologram_name<&gt> <&lt>#<&gt> <&lt>Your <&c><&o><&n>f<&6><&o><&n>o<&e><&o><&n>r<&a><&o><&n>m<&9><&o><&n>a<&b><&o><&n>t<&3><&o><&n>t<&5><&o><&n>e<&d><&o><&n>d<&r> <&b>text<&gt>"
        - narrate ""
        - narrate "<&8>If you don't specify a hologram, it will default to your"
        - narrate "<&8>selected hologram."
        - narrate ""
    script: 
        - if <def[arg2].is[==].to[null]||true> { 
            - narrate "<&4>Not enough arguments. Usage: <&nl> - /h <def[arg1]||setline> <&lt>hologram_name<&gt> <&lt>#<&gt> <&lt>Your text here<&gt><&nl> - /h <def[arg1]||setline> help" 
            - queue clear 
        } else { 
            - if <server.flag[myholograms].contains[<def[arg2]>]||false> { 
                - define setlinehologram <server.flag[hologram_entities].as_list.filter[flag[holoname].is[==].to[<def[arg2]>]].get[1]> 
                - define setlinearg <def[arg2]> 
                - define linenumberarg <def[arg3]> 
                - define linecontents <proc[HologramSymbolProcedure].context[<c.args.get[4].to[9999].space_separated>].parse_color>
            } else if <def[arg2].is[matches].to[number]||false> { 
                - if <player.flag[selectedhologram].is[==].to[null]||true> { 
                    - narrate "<&4>You must select a hologram or specify it in the command. Usage: <&nl>'/h select <&lt>hologram_name<&gt>' - '/h setline <&lt>#<&gt> <&lt>Your text here<&gt>'<&nl>-OR-<&nl>'/h setline <&lt>hologram_name<&gt> <&lt>#<&gt> <&lt>Your text here<&gt>'" 
                    - queue clear 
                } else {
                    - define setlinehologram <server.flag[hologram_entities].as_list.filter[flag[holoname].is[==].to[<player.flag[selectedhologram]>]].get[1]>
                    - define setlinearg <def[setlinehologram].flag[holoname]> 
                    - define linenumberarg <def[arg2]> 
                    - define linecontents <proc[HologramSymbolProcedure].context[<c.args.get[3].to[9999].space_separated>].parse_color>
                } 
            } else { 
                - narrate "<&4>There is no hologram named '<def[arg2]>'. <&nl>You can create a hologram with '/h create <&lt>hologram_name<&gt>'." 
                - queue clear 
            } 
        } 
        - if <def[linecontents].is[==].to[]||true> { 
            - narrate "<&4>You must specify what info you want your hologram to display. Usage: <&nl> - /h <def[arg1]||setline> <&lt>hologram_name<&gt> <&lt>#<&gt> <&lt>Your text here<&gt><&nl> - /h <def[arg1]||setline> help" 
            - queue clear 
        } else { 
            - inject Holograms_Addline
            - queue clear 
        }


Holograms_Addline:
    type: task
    script:
        - define totallines <server.flag[subordinate_holograms].as_list.filter[flag[parent].is[==].to[<def[setlinearg]>]].as_list.size.add[1]||1>
        - define difference <def[totallines].add[1].sub[<def[linenumberarg]>].as_int>
        - define offset <def[linenumberarg].sub[1].div[4.5]>
        - if <def[difference]> < 0 {
            - if <def[totallines]> == <def[linenumberarg].sub[2]> {
                - narrate "<&4>You can't edit that line yet! You must add line <def[totallines].add[1].as_int> first!"
                - queue clear
            } else {
                - narrate "<&4>You can't edit that line yet! You must add lines <def[totallines].add[1].as_int>-<def[linenumberarg].sub[1].as_int> first!"
                - queue clear
            }
        } else if <def[difference]> >= 0 {
            - if <def[linenumberarg]> == 1 {
                - define setlinesubordinate <server.flag[hologram_entities].as_list.filter[flag[holoname].is[==].to[<def[setlinearg]>]].get[1]>
            } else {
                - define setlinesubordinate <server.flag[subordinate_holograms].as_list.filter[flag[parent].is[==].to[<def[setlinearg]>]].get[<def[linenumberarg].sub[1]>]>
            }
            - if <server.flag[subordinate_holograms].as_list.contains[<def[setlinesubordinate]>]> || <server.flag[hologram_entities].as_list.contains[<def[setlinesubordinate]>]> {
                - adjust <def[setlinesubordinate]> custom_name:<def[linecontents]>
                - narrate "<&3>Set line <&b><def[linenumberarg]><&3> of hologram '<&b><def[setlinearg]><&3>' to '<&b><def[linecontents]><&3>'."
            } else {
                - spawn ARMOR_STAND[custom_name=<def[linecontents]>;custom_name_visibility=true;gravity=false] <def[setlinehologram].location.sub[0.0,<def[offset]>,0.0]> save:newhologram
                - flag <entry[newhologram].spawned_entities.get[1]> parent:<def[setlinearg]>
                - flag <entry[newhologram].spawned_entities.get[1]> is_invulnerable:1
                - flag <entry[newhologram].spawned_entities.get[1]> offset:<def[offset]>
                - invisible <entry[newhologram].spawned_entities.get[1]> state:true
                - flag server subordinate_holograms:->:<entry[newhologram].spawned_entities.get[1]>
                - narrate "<&3>Set line <&b><def[linenumberarg]><&3> of hologram '<&b><def[setlinearg]><&3>' to '<&b><def[linecontents]><&3>'."
            }
        }


Holograms:
    type: command
    name: holograms
    usage: /h <&lt>help<&gt>
    aliases:
        - h
        - holo
        - hologram
    allowed help:
        - determine <player.is_op||<context.server>>
    description: Berufeng's Holograms plugin!
    tab complete:
        - if <player.is_op.not||<context.server>> queue clear
        - determine <li@create|remove|movehere|help.filter[starts_with[<context.args.last>]]>
    script:
        - if <player.is_op.not||<context.server>> {
            - narrate "<&4>You do not have permission to use that command."
            - queue clear
        }
        - if <context.raw_args.is[==].to[]||false> {
            - narrate "<&3>'<&b>Holograms<&3>' by Berufeng. Type <&b>/h help <&3>for more info."
            - queue clear
        }
        - define arg1 <c.args.get[1].escaped||null>
        - define arg2 <c.args.get[2].escaped||null>
        - define arg3 <c.args.get[3].escaped||null>
        - define arg4 <c.args.get[4].escaped||null>
        - choose <def[arg2]>:
            - case help:
                - choose <def[arg1]>:
                    - case help:
                        - inject s@Holograms_Help path:help
                    - case create:
                        - inject s@Holograms_Create path:help
                    - case new:
                        - inject s@Holograms_Create path:help
                    - case add:
                        - inject s@Holograms_Create path:help
                    - case addnew:
                        - inject s@Holograms_Create path:help
                    - case c:
                        - inject s@Holograms_Create path:help
                    - case remove:
                        - inject s@Holograms_Remove path:help
                    - case rem:
                        - inject s@Holograms_Remove path:help
                    - case r:
                        - inject s@Holograms_Remove path:help
                    - case delete:
                        - inject s@Holograms_Remove path:help
                    - case del:
                        - inject s@Holograms_Remove path:help
                    - case movehere:
                        - inject s@Holograms_Movehere path:help
                    - case tphere:
                        - inject s@Holograms_Movehere path:help
                    - case tpto:
                        - inject s@Holograms_Tpto path:help
                    - case move:
                        - inject s@Holograms_Tpto path:help
                    - case moveto:
                        - inject s@Holograms_Tpto path:help
                    - case tp:
                        - inject s@Holograms_Tpto path:help
                    - case select:
                        - inject s@Holograms_Select path:help
                    - case sel:
                        - inject s@Holograms_Select path:help
                    - case s:
                        - inject s@Holograms_Select path:help
                    - case setline:
                        - inject s@Holograms_Setline path:help
                    - case addline:
                        - inject s@Holograms_Setline path:help
                    - case adjust:
                        - inject s@Holograms_Setline path:help
                    - case edit:
                        - inject s@Holograms_Setline path:help
                    - default:
                        - narrate "<&4>I'm sorry, I didn't understand your request for help. Type /h help for a list of commands."
            - default:
                - choose <def[arg1]>:
                    - case help:
                        - inject Holograms_Help
                    - case create:
                        - inject Holograms_Create
                    - case new:
                        - inject Holograms_Create
                    - case add:
                        - inject Holograms_Create
                    - case addnew:
                        - inject Holograms_Create
                    - case c:
                        - inject Holograms_Create
                    - case remove:
                        - inject Holograms_Remove
                    - case rem:
                        - inject Holograms_Remove
                    - case r:
                        - inject Holograms_Remove
                    - case delete:
                        - inject Holograms_Remove
                    - case del:
                        - inject Holograms_Remove
                    - case movehere:
                        - inject Holograms_Movehere
                    - case tphere:
                        - inject Holograms_Movehere
                    - case tpto:
                        - inject Holograms_Tpto
                    - case move:
                        - inject Holograms_Tpto
                    - case moveto:
                        - inject Holograms_Tpto
                    - case tp:
                        - inject Holograms_Tpto
                    - case select:
                        - inject Holograms_Select
                    - case sel:
                        - inject Holograms_Select
                    - case s:
                        - inject Holograms_Select
                    - case list:
                        - inject Holograms_List
                    - case setline:
                        - inject Holograms_Setline
                    - case set:
                        - inject Holograms_Setline
                    - case addline:
                        - inject Holograms_Setline
                    - case adjust:
                        - inject Holograms_Setline
                    - case edit:
                        - inject Holograms_Setline
                    - default:
                        - narrate "<&4>I'm sorry, I didn't understand your request. Type /h help for a list of commands."