Paste #117375: script

Date: 2023/11/10 06:08:06 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


ballArmorStand:
  type: entity
  debug: false
  entity_type: armor_stand
  mechanisms:
    passengers: ballHitboxEntity
    visible: false
    gravity: false
    is_small: true
    marker: true
    equipment:
      helmet: ballHead
    custom_name: <&r><&6>Мяч
    #custom_name_visible: true

ballHitboxEntity:
  type: entity
  debug: false
  entity_type: magma_cube
  mechanisms:
    invisible: true
    visible: false
    silent: true
    has_ai: false
    collidable: false
    persistent: true
    size: 2
    # potion_effects:
    #   - [type=INVISIBILITY;amplifier=255;duration=99999s;ambient=false;particles=false;icon=false]

tempStand:
  type: entity
  debug: false
  entity_type: armor_stand
  mechanisms:
    visible: false
    is_small: true
    invulnerable: true
    gravity: false
    marker: true

ballHead:
  type: item
  debug: false
  material: player_head
  mechanisms:
    skull_skin: eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvMWU2ZGYxYzJiZjViOTE4ZjZjODg3OWFmNGM0ZWNjMWRhYmJlMzcyMjkyODRlMWY4ZjZiY2NkYjFlYTNkMGFjIn19fQ==

ballpickupHandler:
  type: world
  debug: false
  permission: dmc.admin
  events:
    on player right clicks ballHitboxEntity:
      - ratelimit <server.online_players> 1s
      - define number <context.entity>
      - define skin <[number].flag[ballskin]>
      - define item <player.item_in_hand.material>
      - if <player.item_in_hand.material> == m@feather:
        - if <player.item_in_hand.has_lore>:
          - animate <player> animation:ARM_SWING
          - define ball <context.entity.vehicle>
          - playsound <context.entity.location> sound:entity_villager_work_cartographer
          - playeffect at:<context.entity.location.above[1]> effect:DUST_COLOR_TRANSITION special_data:1|green|red offset:1 quantity:15 data:0.05 visibility:100 velocity:0,0.1,0
          - define skin <player.item_in_hand.flag_map.keys.formatted>
          - take iteminhand
          - equip <[ball]> head:<item[player_head].with[skull_skin=<[skin]||eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvMWU2ZGYxYzJiZjViOTE4ZjZjODg3OWFmNGM0ZWNjMWRhYmJlMzcyMjkyODRlMWY4ZjZiY2NkYjFlYTNkMGFjIn19fQ==>]>
          - flag <[number]> ballskin:<[skin]>
          - flag <player> ballskin:!
          - stop
      - foreach <script[colorSettings].data_key[data]> key:skin:
        - if <player.item_in_hand.material> == <[value].get[name]>:
          - take iteminhand
          - animate <player> animation:ARM_SWING
          - define ball <context.entity.vehicle>
          - playsound <context.entity.location> sound:entity_villager_work_leatherworker
          - playeffect at:<context.entity.location.above[1]> effect:item_crack special_data:<[item]> offset:0.5 quantity:15 data:0.05 visibility:100 velocity:0,0.1,0
          - define skin <[value].get[skin]>
          - equip <[ball]> head:<item[player_head].with[skull_skin=<[skin]||eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvMWU2ZGYxYzJiZjViOTE4ZjZjODg3OWFmNGM0ZWNjMWRhYmJlMzcyMjkyODRlMWY4ZjZiY2NkYjFlYTNkMGFjIn19fQ==>]>
          - flag <[number]> ballskin:<[skin]>
          - flag <player> ballskin:!
          - stop
      - if <player.has_flag[balled].not> && <context.location.below[0.5].material> != m@air && <server.has_flag[oneplayer].not>:
        - flag <player> balled
        - flag <player> ballowner
        - flag server oneplayer expire:2t
        - define ball <context.entity>
        - if <[ball].has_flag[ballnumber]>:
          - flag <player> ballnumber:!
          - flag <player> ballnumber:<[ball].flag[ballnumber]>
          - flag <player> ballskin:<[ball].flag[ballskin]>
            #- narrate <player.flag[ballnumber]>
        - else:
          - flag <player> ballnumber:<&f><Уникальный><&sp><номер><&sp><&7><&gt><&sp><&6><util.random.int[<0>].to[<1000>]>
          - flag <player> ballskin:eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvMWU2ZGYxYzJiZjViOTE4ZjZjODg3OWFmNGM0ZWNjMWRhYmJlMzcyMjkyODRlMWY4ZjZiY2NkYjFlYTNkMGFjIn19fQ==
        - remove <context.entity.vehicle>
        - remove <context.entity>
        #- remove <context.location.find_entities[ballarmorstand].within[0.01]>
        #- remove <context.location.find_entities[ballHitboxEntity].within[0.01]>
        #- remove <context.location.find_entities[magma_cube].within[0.01]>
        - animate <player> animation:ARM_SWING
        - flag server oneplayer:!
        - give to:<player.inventory> ballItem
        - playsound <context.location> sound:item_armor_equip_generic pitch:1
        - flag <player> balled:!
            #- narrate <player.item_in_hand.lore>
        - stop
        #- run deletetask
      - else:
        - wait 1t

ballplaceHandler:
  type: world
  debug: false
  permission: dmc.admin
  events:
    on player places ballItem using:off_hand:
    - determine cancelled
    on player right clicks block with:bundle:
    - foreach <player.item_in_hand.inventory_contents>:
      - if <[value].script.name.equals[ballitem]||false>:
        - determine cancelled
    on player places ballItem:
    - if <server.recent_tps.first> < 15:
      - determine cancelled
    - define num <player.item_in_hand.lore.first>
    - define skin <player.item_in_hand.skull_skin>
    #- narrate <[skin]>
    - modifyblock <context.location> air
    #- determine passively cancelled
    #- take item:ballItem
    - flag <player> ballowner:!
    - announce to_console "Мяч поставил <player.name>!"
    - playsound <context.location> sound:item_armor_equip_turtle pitch:1
    - spawn ballarmorstand <context.location.center.below[0.5]> save:ball
    - define ball <entry[ball].spawned_entity>
    - define number <[ball].passenger>
    - adjust <[number]> hide_from_players
    - wait 4t
    - equip <[ball]> head:<item[player_head].with[skull_skin=<[skin]||eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvMWU2ZGYxYzJiZjViOTE4ZjZjODg3OWFmNGM0ZWNjMWRhYmJlMzcyMjkyODRlMWY4ZjZiY2NkYjFlYTNkMGFjIn19fQ==>]>
    - adjust <[number]> show_to_players
    - flag <[number]> ballnumber:!
    - flag <[number]> ballnumber:<[num]>
    - flag <[number]> ballskin:<[skin]>
    #- narrate <[num]>
    - flag <player> ballnumber:!
    - flag <player> ballskin:!
    #- modifyblock <context.location> air

balldropHandler:
  type: world
  debug: false
  permission: dmc.admin
  events:
    after player drops ballItem:
    - if <server.recent_tps.first> < 15:
      - determine cancelled
    - if <player.is_sneaking.not>:
      #- adjust <[ballHitboxEntity]> visible:false
      - define num <context.item.lore.first>
      - define mat      <context.item.material>
      - define skin <context.item.skull_skin||eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvMWU2ZGYxYzJiZjViOTE4ZjZjODg3OWFmNGM0ZWNjMWRhYmJlMzcyMjkyODRlMWY4ZjZiY2NkYjFlYTNkMGFjIn19fQ==>
      - define entity   <player.location.center.find_entities[dropped_item].within[3].filter[item.material.equals[<[mat]>]].first.if_null[]>
      - announce to_console "Мяч выбросил <player.name>!"
      - announce to_console "Мяч выбросил <player.location.simple>!"
      - remove <[entity]>
      - flag <player> ballowner:!
      - playsound <context.location> sound:item_armor_equip_turtle pitch:1
      - spawn ballarmorstand <player.eye_location.forward[1.5].below[0.8]> save:ballnumber
      - define ball <entry[ballnumber].spawned_entity>
      - define ballnumber <entry[ballnumber].spawned_entity>
      - define number <[ball].passenger>
      - adjust <[number]> hide_from_players
      - wait 1t
      - adjust <[number]> show_to_players
      - equip <[ball]> head:<item[player_head].with[skull_skin=<[skin]||eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvMWU2ZGYxYzJiZjViOTE4ZjZjODg3OWFmNGM0ZWNjMWRhYmJlMzcyMjkyODRlMWY4ZjZiY2NkYjFlYTNkMGFjIn19fQ==>]>
      - flag <[number]> ballnumber:!
      - flag <[number]> ballnumber:<[num]>
      - flag <[number]> ballskin:<[skin]>
      #- narrate <[num]>
      - flag <player> ballnumber:!
      - flag <player> ballskin:!
      - adjust <[ball]> damage:1
      - wait 1t
    #- define power 0.2
      - define power 0.23
      - flag <[ball]> velocity:<player.eye_location.forward[<[power]>].sub[<player.eye_location>]>
      - animate <player> animation:ARM_SWING
        #- modifyblock <context.location> air

deletetask:
  type: task
  debug: false
  script:
    - if <player.has_flag[balled]>:
        - animate <player> animation:ARM_SWING
        - give ballItem
        - flag <player> balled:!
    - else:
        - wait 1t

ballItem:
  type: item
  material: player_head
  display name: <&r>Мяч
  lore:
  - <player.flag[ballnumber]||<&f>Уникальный<&sp>номер<&sp><&7><&gt><&sp><&6><util.random.int[0].to[1000]>>
  allow in material recipes: true
  flags:
      my_flag: <util.random_uuid>
  mechanisms:
    skull_skin: <player.flag[ballskin]||eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvMWU2ZGYxYzJiZjViOTE4ZjZjODg3OWFmNGM0ZWNjMWRhYmJlMzcyMjkyODRlMWY4ZjZiY2NkYjFlYTNkMGFjIn19fQ==>
  recipes:
      1:
        type: shaped
        recipe_id: my_custom_item_id
        group: my_custom_group
        output_quantity: 1
        input:
            - rabbit_hide|string|rabbit_hide
            - string|material:pufferfish_bucket|string
            - rabbit_hide|string|rabbit_hide

ballcraftHandler:
  type: world
  debug: false
  events:
    on player crafts ballItem:
        - if <player.has_flag[ballimit].not> && <player.has_permission[dmc.prime].not>:
            - flag <player> ballimit expire:6h
        - else:
            - if <player.has_flag[ballimit].not> && <player.has_permission[dmc.prime]>:
                - flag <player> ballimit expire:1h
            - else:
                - narrate "<&c>Вы сможете скрафтить новый мяч через <player.flag_expiration[ballimit].add[1t].duration_since[<util.time_now>].formatted.replace_text[s].with[с].replace_text[m].with[м].replace_text[h].with[ч].replace_text[d].with[д]>."
                - determine cancelled

testcmd:
  type: command
  name: test
  usage: /test
  permission: dmc.prime
  debug: false
  script:
    - foreach <player.luckperms_tracks> as:entry:
        - narrate "found <[entry]>" <player>

ballskin:
  type: command
  name: ball
  usage: /ball
  permission: dmc.prime
  debug: false
  tab complete:
    - choose <context.args.size>:
      - case 0:
        - determine <list[skin|info]>
      - case 1:
        - if <context.args.get[1].advanced_matches[skin|info]||false> && <context.raw_args.split[].last.equals[<&sp>].not>:
          - determine <list>
        - if <context.args.get[1].advanced_matches[skin|info].not> && <context.raw_args.split[].last.equals[<&sp>].not>:
          - define matchingActions <list[skin|info].filter[advanced_matches[<context.args.get[1]>*]]||<list>>
          - determine <[matchingActions]>
        - choose <context.args.get[1]>:
          - case skin:
            - determine 'Код головы'
          - case info:
            - determine <empty>
          - default:
            - determine <list>
  script:
    - define action <context.args.get[1]||null>
    - if <[action].advanced_matches[info|skin].not||true>:
      - narrate '<&c>Выберите действие! (info|skin)'
      - stop
    - choose <[action]>:
      - case info:
        - if <player.item_in_hand.display> == Мяч:
            - narrate '<&a>В ваших руках мяч с описанием <&r>«<player.item_in_hand.lore.formatted><&r>»<&a> и скином <&6><player.item_in_hand.skull_skin.split[|].get[3]>'
        - else:
            - narrate "<&c>У вас в руках должен быть мяч!"
      - case skin:
        - define skin <context.args.get[2].to[<context.args.size>].separated_by[<&sp>]||null>
        - if <player.has_flag[ballskintimer].not>:
            - if <[skin]> == null:
                - narrate '<&c>Введите код головы!'
                - stop
            - if <player.item_in_hand.material> == m@feather:
                - if <player.item_in_hand.quantity> == 1:
                    - define done '<&7>Готово к использованию!'
                    - inventory adjust slot:<player.held_item_slot> flag:<[skin]>
                    - inventory adjust slot:<player.held_item_slot> lore:<[done]>
                    - narrate "<&a>Скин на перо успешно установлен!"
                    - flag <player> ballskintimer expire:5m
                - else:
                    - narrate "<&c>У вас в руках должен быть предмет в количестве 1!"
            - else:
                - narrate "<&c>У вас в руках должно быть перо!"
        - else:
            - narrate "<&c>Вы сможете поставить скин на мяч через <player.flag_expiration[ballskintimer].add[1t].duration_since[<util.time_now>].formatted.replace_text[s].with[с].replace_text[m].with[м].replace_text[h].with[ч].replace_text[d].with[д]>."

ballHandler:
  type: world
  debug: false
  events:
    on ballHitboxEntity exits vehicle:
      - determine cancelled
    after ballArmorStand spawns:
      - run updateBall def.ball:<context.entity>
      - run updateBallHitbox def.entity:<context.entity.passenger>
    on ballHitboxEntity damaged:
      - determine passively cancelled
      - if <context.damager.is_player.not||true>:
        - stop
      - define ball <context.entity.vehicle>
      - ratelimit <player> 10t
      - ratelimit <server.online_players> 10t
      #- animate <context.damager> animation:ARM_SWING_OFFHAND
      - if <context.damager.is_sneaking>:
        #- define power 0.3
        - define power 0.01
        - flag <[ball]> velocity:<player.eye_location.forward[<[power]>].sub[<player.eye_location.below[0.45]>]>
        - playsound sound:ENTITY_GENERIC_SMALL_FALL <[ball].flag[rawLocation].above[1]> pitch:1.6
        - playeffect effect:sweep_attack at:<[ball].flag[rawLocation].above[1]> offset:0 visibility:100
        - determine cancelled
      - if <context.damager.is_on_ground.not> && <context.damager.is_sprinting>:
        #- define power 0.48
        - define power 0.8
        - flag <[ball]> super
        - flag <[ball]> velocity:<player.eye_location.forward[<[power]>].sub[<player.eye_location>]>
        - playsound sound:ENTITY_GENERIC_SMALL_FALL <[ball].flag[rawLocation].above[1]> pitch:1.6
        - playeffect effect:explosion_large at:<[ball].flag[rawLocation].above[1]> offset:0 visibility:100
        - if <[ball].has_flag[super]>:
            - repeat 15:
                - if <[ball].location.above[0.1].material.is_solid.not>:
                    - playeffect effect:sweep_attack at:<[ball].flag[rawLocation].above[1]> offset:0 visibility:100
                    - playeffect effect:REDSTONE special_data:1|white at:<[ball].flag[rawLocation].above[1.5]> offset:0 visibility:100
                    - wait 4t
            - flag <[ball]> super:!
        - determine cancelled
      - if <context.damager.is_on_ground.not>:
        #- define power 0.48
        - define power 0.6
        - flag <[ball]> velocity:<player.eye_location.forward[<[power]>].sub[<player.eye_location>]>
        - playsound sound:ENTITY_GENERIC_SMALL_FALL <[ball].flag[rawLocation].above[1]> pitch:1.6
        - playeffect effect:explosion_large at:<[ball].flag[rawLocation].above[1]> offset:0 visibility:100
        - determine cancelled
      - if <context.damager.is_sprinting||false>:
        #- define power 0.58
        - define power 0.75
        - flag <[ball]> super
      - else:
        #- define power 0.4
        - define power 0.52
      - flag <[ball]> velocity:<player.eye_location.forward[<[power]>].sub[<player.eye_location>]>
      - playsound sound:ENTITY_GENERIC_SMALL_FALL <[ball].flag[rawLocation].above[1]> pitch:1.6
      - playeffect effect:sweep_attack at:<[ball].flag[rawLocation].above[1]> offset:0 visibility:100
      - if <[ball].has_flag[super]>:
        - repeat 8:
            - if <[ball].location.above[0.1].material> == m@air:
                - playeffect effect:sweep_attack at:<[ball].flag[rawLocation].above[1]> offset:0 visibility:100
                - wait 7t
        - flag <[ball]> super:!

balllist:
  type: command
  name: balllist
  permission: dmc.admin
  usage: /balllist
  script:
    - narrate "<&a>Мяч есть у:"
    #- foreach <server.players.filter[flag[ballowner]].parse[name]>:
        #- narrate "<&7>- <[value]>" targets:<player>
    - foreach <server.offline_players.filter[enderchest.contains.display[strict:Мяч]].parse[name]>:
        - narrate <[value]> targets:<player>

updateBallHitbox:
  type: task
  debug: false
  definitions: entity
  script:
    - wait 1t
    - while <[entity].is_spawned||false>:
      - if <[entity].vehicle||null> == null:
        - remove <[entity]>
        - stop
      - wait 1t

getBallOffset:
  type: procedure
  debug: false
  definitions: ball
  script:
    - define turn <[ball].armor_pose_map.get[head].x>
    - define y <element[3.14].sub[<[turn].sub[3.14].abs>].div[3.14].mul[0.4]>
    - determine <map[y=<[y]>]>

updateBall:
  type: task
  debug: false
  definitions: ball
  script:
    - flag <[ball]> velocity:<location[0,0,0]>
    - define gravity <location[0,-0.4,0]>
    - define rawLocation <[ball].location>
    - while <[ball].is_spawned>:
      #- playeffect effect:smoke at:<[rawLocation].above[1]> offset:0 quantity:10
      - chunkload <[ball].location.chunk> duration:3s
      - if <[rawLocation].above[1].block.is_liquid||false>:
        - flag <[ball]> velocity:<[ball].flag[velocity].mul[0.7]>
        - define gravity <location[0,0.6,0]>
      - else:
        - define gravity <location[0,-0.4,0]>
      #- spawn tempStand <[ball].location.above[1]> save:tempStand
      #- define tempStand <entry[tempStand].spawned_entity>
      #- adjust <[tempStand]> hide_from_players
      - look <[ball]> <[ball].location.add[<[ball].flag[velocity].mul[10]>]>
      - define hit <[ball].location.above.ray_trace[entities=!ballHitboxEntity]||null>
      #- adjust <[tempStand]> show_to_players
      - if <[hit].distance[<[rawLocation].above[1]>]||5> >= <[ball].flag[velocity].vector_length.add[0.5]>:
        #- flag <[ball]> velocity:<[ball].flag[velocity].add[<[gravity].div[10]>]>
        - flag <[ball]> velocity:<[ball].flag[velocity].add[<[gravity].div[14]>]>
      - else:
        #- teleport <[ball]> <[hitLoc].below[<[ball].eye_height>].below[0.25]>
        - flag <[ball]> velocity:<[ball].flag[velocity].mul[0.6]>
        - if <[ball].flag[velocity].vector_length> <= 0.05:
          - flag <[ball]> velocity:<location[0,0,0]>
        - else:
          #- spawn tempStand <[rawLocation].above[1]> save:tempStand
          #- define tempStand <entry[tempStand].spawned_entity>
          #- adjust <[tempStand]> hide_from_players
          - look <[ball]> <[ball].location.add[<[ball].flag[velocity].mul[10]>]>
          - wait 1t
          - define hitNormal <[ball].location.above[1].backward[0.3].ray_trace[entities=!ballHitboxEntity;return=normal]||null>
          - define hit <[ball].location.above[1].backward[0.3].ray_trace[entities=!ballHitboxEntity;return=block]||null>
          #- narrate <[hitNormal]> targets:<server.online_ops>
          - define axis <list[x|y|z]>
          - foreach <[hitNormal].xyz.split[,]>:
            - if <[value]> != 0:
              - define hitAxis <[axis].get[<[loop_index]>]>
          - playsound sound:ENTITY_GENERIC_SMALL_FALL <[ball].flag[rawLocation].above[1]> pitch:1.6
          - playeffect effect:BLOCK_DUST at:<[ball].location.above[0.6]> special_data:<[hit].block.material> offset:0 quantity:15 data:0.05 visibility:100
          - choose <[hitAxis]>:
            - case x:
              - flag <[ball]> velocity:<[ball].flag[velocity].with_x[<[ball].flag[velocity].x.mul[-1]>]>
            - case y:
              - flag <[ball]> velocity:<[ball].flag[velocity].with_y[<[ball].flag[velocity].y.mul[-1]>]>
            - case z:
              - flag <[ball]> velocity:<[ball].flag[velocity].with_z[<[ball].flag[velocity].z.mul[-1]>]>
      - adjust <[ball]> armor_pose:head=<[ball].armor_pose_map.get[head].x.add[<[ball].flag[velocity].vector_length.mul[0.6]>]>,<[ball].armor_pose_map.get[head].y>,<[ball].armor_pose_map.get[head].z>
      - define rawLocation <[rawLocation].add[<[ball].flag[velocity]>]>
      - if <[rawLocation].above[1].block.material.is_occluding||false>:
        - define rawLocation <[rawLocation].find_blocks.within[2].filter[material.is_solid.not].get[1].center.below[1]>
      - teleport <[ball]> <[rawLocation].add[<[ball].flag[velocity]>].above[<proc[getBallOffset].context[<[ball]>].get[y]>].with_yaw[<[ball].location.yaw>].with_pitch[<[ball].location.pitch>]>
      - if <[ball].flag[velocity].vector_length> > 0.05:
        - look <[ball]> <[ball].location.above[1].add[<[ball].flag[velocity].mul[10]>]>
      #- narrate <[rawLocation].above[1].add[<[ball].flag[velocity]>]>
      #- narrate <[ball].flag[velocity]> targets:<server.online_ops>
      - flag <[ball]> rawLocation:<[rawLocation]>
      - wait 1t

hoverableColor:
  type: procedure
  debug: false
  definitions: type
  script:
    - define data <script[colorSettings].data_key[data].deep_get[<[type]>]>
    - define text <[data].get[skin].parsed>
    - determine <[text]>

colorSettings:
  type: data
  debug: false
  data:
    white:
      name: m@white_dye
      skin: eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvMWU2ZGYxYzJiZjViOTE4ZjZjODg3OWFmNGM0ZWNjMWRhYmJlMzcyMjkyODRlMWY4ZjZiY2NkYjFlYTNkMGFjIn19fQ==
    red:
      name: m@red_dye
      skin: eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvOTUzNTgzNDFkNTM2ODVhNGU1YjE1YzRkNjVkNTg2OGJlNWEzZDU1MDY2ZmFmMDJlYTlkOTJkZGUyMTIzNCJ9fX0=
    lime:
      name: m@lime_dye
      skin: eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvY2M1NDJhZmViOGM3OTFhNGVhMzU4MTU1NjQyOTBhZGY1M2E5NjQxZDgzMjhiNjlmYjMyZTMyYWVkMWFlOSJ9fX0=
    blue:
      name: m@blue_dye
      skin: eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvM2Q0MDI4YzAxMWQ2MzYzM2QyZWMwNGE5NDE2NzI5NDhiZjAxMWQxZDdhNGYxNDVmOGNlNjljNzE3MmQzIn19fQ==
    light_blue:
      name: m@light_blue_dye
      skin: eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvOWE4ZmViODk3OWY3ZTkyN2Q2OWNhODNlZjc4M2NjOWIzNmQ4ZjEwZDU5Yzc5MzA5YWE2N2I4ZWY2MjM4NmQifX19
    purple:
      name: m@purple_dye
      skin: eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvNmRiNmVjNmEyMWY2N2FhNTRkZDgxNzA5YjRiN2Q1ZmM5NzUzMmE1M2Y0MGQ5OWZmYzdmNWMxNmY0NzQ3Mzg1In19fQ==
    orange:
      name: m@orange_dye
      skin: eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvNTI3YjIyYjNiMjk1NGMzNDFmZDZlYjc4Yzg2MDliYzUyYzFlNjU4MTE3Y2E1YmQ5ZGM4NDViNmM5YmQ1YjQ0In19fQ==
    black:
      name: m@black_dye
      skin: eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvNjFiMDE2NWVlMmIzMjI5NjhmMDE4MDM0YjhkN2UyZGY2MTM1ZmE5NGJlYTdhZTgxY2RmMGJjYjY2YWMyIn19fQ==
    yellow:
      name: m@yellow_dye
      skin: eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvY2ZlOGIyZTkxOTE3NDI2ZjNlZjhkODVkM2Y2YzA0ZmZmYWU5ZWQ1MTZhNjlhMzQ4ZjNmOWJjZWU0YTljOTEifX19