Date: 2020/03/22 14:01:54 UTC-07:00
Type: Denizen Script
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
Holographic Titles:
type: command
debug: false
name: holotitles
description: Used to create holographic titles in the world.
usage: /holotitles <&lb>create/remove/move/list<&rb> <&lb>title<&rb> <&lb>text<&rb>
aliases:
- holo
- ht
permission: holotitles
permission message: <&e>Type /help for a list of commands.
allowed help:
- determine <player.in_group[admin]||<context.server>>
tab complete:
- if !<player.in_group[admin]||<context.server>>:
- stop
- determine <server.list_online_players.parse[name].include[create|remove|move|list].filter[starts_with[<context.args.last||>]]>
script:
- if !<player.in_group[admin]||<context.server>>:
- narrate "<&e>Type /help for a list of commands."
- stop
- choose <context.args.get[1]>:
- case create:
- define title <context.args.get[2]||null>
- define text <context.args.get[3]||null>
- if <[title]> == null:
- narrate "<&9>Holotitles<&co> <&c>No value entered for title. <&nl><&b>Proper format<&co> <&7>/holo create [title] [text]"
- stop
- else if <[text]> == null:
- narrate "<&9>Holotitles<&co> <&c>No value entered for text. <&nl><&b>Proper format<&co> <&7>/holo create [title] [text]"
- stop
- else:
- define textString <context.raw_args.after[<context.args.get[2]>].trim.parse_color>
- spawn "armor_stand[custom_name_visible=true;custom_name=<[textString]>;gravity=false;visible=false]" <player.location.center.sub[0,1,0]> save:standTitle
- yaml id:holotitles_list set <player.world.name>.<[title]>.location:<entry[standTitle].spawned_entities.get[1].location>
- yaml id:holotitles_list set <player.world.name>.<[title]>.entityName:<entry[standTitle].spawned_entities.get[1]>
- yaml id:holotitles_list set <player.world.name>.<[title]>.text:<[textString]>
- yaml "savefile:/yml_saves/holotitles_list.yml" id:holotitles_list
- narrate "<&9>Holotitles<&co> <&e>Holo title <&b><[title]> <&e>created at <player.location.center.sub[0,1,0].xyz.replace[,].with[, ]>."
- case remove:
- define title <context.args.get[2]||null>
- if <[title]> == null:
- narrate "<&9>Holotitles<&co> <&c>No value entered for title. <&nl><&b>Proper format<&co> <&7>/holo remove [title]"
- stop
- else:
- remove <yaml[holotitles_list].read[<player.world.name>.<[title]>.entityName]>
- wait 1t
- yaml id:holotitles_list set <player.world.name>.<[title]>:!
- yaml "savefile:/yml_saves/holotitles_list.yml" id:holotitles_list
- case move:
- define title <context.args.get[2]||null>
- define moveX <context.args.get[3]||null>
- define moveY <context.args.get[4]||null>
- define moveZ <context.args.get[5]||null>
- if <[title]> == null:
- narrate "<&9>Holotitles<&co> <&c>No value entered for title. <&nl><&b>Proper format<&co> <&7>/holo move [title] [X] [Y] [Z]"
- stop
- else if <[moveX]> == null:
- narrate "<&9>Holotitles<&co> <&c>No value entered for title. <&nl><&b>Proper format<&co> <&7>/holo move [title] [X] [Y] [Z]"
- stop
- else if <[moveY]> == null:
- narrate "<&9>Holotitles<&co> <&c>No value entered for title. <&nl><&b>Proper format<&co> <&7>/holo move [title] [X] [Y] [Z]"
- stop
- else if <[moveZ]> == null:
- narrate "<&9>Holotitles<&co> <&c>No value entered for title. <&nl><&b>Proper format<&co> <&7>/holo move [title] [X] [Y] [Z]"
- stop
- else:
- define entityID <yaml[holotitles_list].read[<player.world.name>.<[title]>.entityName]>
- teleport <[entityID]> <[entityID].location.add[<[moveX]>,<[moveY]>,<[moveZ]>]>
- yaml id:holotitles_list set <player.world.name>.<[title]>.location:<[entityID].location>
- yaml "savefile:/yml_saves/holotitles_list.yml" id:holotitles_list
- case edit:
- define title <context.args.get[2]||null>
- define text <context.args.get[3]||null>
- if <[title]> == null:
- narrate "<&9>Holotitles<&co> <&c>No value entered for title. <&nl><&b>Proper format<&co> <&7>/holo edit [title] [text]"
- stop
- if !<yaml[holotitles_list].contains[<player.world.name>.<[title]>]>:
- narrate NOPE
- else if <[text]> == null:
- narrate "<&9>Holotitles<&co> <&c>No value entered for text. <&nl><&b>Proper format<&co> <&7>/holo edit [title] [text]"
- stop
- else:
- define textString <context.raw_args.after[<context.args.get[2]>].trim.parse_color>
- adjust <yaml[holotitles_list].read[<player.world.name>.<[title]>.entityName]> custom_name:<[textString]>
- yaml id:holotitles_list set <player.world.name>.<[title]>.text:<[textString]>
- yaml "savefile:/yml_saves/holotitles_list.yml" id:holotitles_list
- narrate "<&9>Holotitles<&co> <&e>Holo title <&b><[title]> <&e>has been updated."
- case list:
- define range <context.args.get[2]||null>
- if <[range]> == null:
- narrate "<&9>Holotitles<&co> <&c>No value entered for range. <&nl><&b>Proper format<&co> <&7>/holo list [range]"
- stop
- else if !<[range].is_decimal>:
- narrate "<&9>Holotitles<&co> <&c>Range value must be a number. <&nl><&b>Proper format<&co> <&7>/holo list [range]"
- stop
- else if <[range]> > 20:
- narrate "<&9>Holotitles<&co> <&c>Range value cannot exceed 20."
- else:
- define none_found "<&c>No holo titles were found within the specified range."
- foreach <yaml[holotitles_list].list_keys[<player.world.name>]> as:StandName:
- define listX <yaml[holotitles_list].read[<player.world.name>.<[StandName]>.location].as_location.x>
- define listY <yaml[holotitles_list].read[<player.world.name>.<[StandName]>.location].as_location.y>
- define listZ <yaml[holotitles_list].read[<player.world.name>.<[StandName]>.location].as_location.z>
- if <player.location.x.sub[<[listX]>].abs> <= <[range]>:
- if <player.location.y.sub[<[listY]>].abs> <= <[range]>:
- if <player.location.z.sub[<[listZ]>].abs> <= <[range]>:
- define StandList:->:<[StandName]>
- narrate "<&9>Holotitles (<&a><[range]><&9>)<&co> <&b><[StandList].comma_separated.replace[,].with[<&7>,<&b>]||<[none_found]>>"
- case check:
- define title <context.args.get[2]||null>
- if <yaml[holotitles_list].contains[<player.world.name>.<[title]>]>:
- define entity <yaml[holotitles_list].read[<player.world.name>.<[title]>.entityName].as_entity>
- define textSave <yaml[holotitles_list].read[<player.world.name>.<[title]>.entityName].as_entity.custom_name>
- adjust <[entity]> "custom_name:<&a>--<>> Current Selection<&co> <&b><[title]> <&a><<>--"
- wait 10t
- adjust <[entity]> custom_name:<[textSave]>
- wait 10t
- adjust <[entity]> "custom_name:<&a>--<>> Current Selection<&co> <&b><[title]> <&a><<>--"
- wait 10t
- adjust <[entity]> custom_name:<[textSave]>
- else:
- narrate "<&9>Holotitles<&co> <&c>Invalid holo title selected. <&nl><&b>Proper format<&co> <&7>/holo check [title]"
- case help:
- narrate Help
- default:
- narrate "<&c>Invalid sub-command! Type /holo help for a list of commands."
holotitles_load:
type: world
debug: false
events:
on server start:
- yaml "load:/yml_saves/holotitles_list.yml" id:holotitles_list