Date: 2025/03/18 05:02:15 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
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
#███████╗██╗░░██╗███████╗███╗░░░███╗███████╗░░░░░██╗██╗███╗░░██╗
#══██╔══╝██║░░██║██╔════╝████╗░████║██╔════╝░░░░░██║██║████╗░██║
#░░██║░░░███████║█████╗░░██╔████╔██║█████╗░░░░░░░██║██║██╔██╗██║
#░░██║░░░██╔══██║██╔══╝░░██║╚██╔╝██║██╔══╝░░██╗░░██║██║██║╚████║
#░░██║░░░██║░░██║███████╗██║░╚═╝░██║███████╗╚█████╔╝██║██║░╚███║
#░░╚═╝░░░╚═╝░░╚═╝╚══════╝╚═╝░░░░░╚═╝╚══════╝░╚════╝░╚═╝╚═╝░░╚══╝
present_item:
type: item
material: player_head
display name: <&f>Подарок
recipes:
1:
type: shaped
input:
- air|string|air
- air|barrel|air
- air|leather|air
mechanisms:
skull_skin: eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvYzZlNjliMWM3ZTY5YmNkNDllZDk3NGY1YWMzNmVhMjc1ZWZhYmI4YzY0OWNiMmIxZmU5ZDZlYTYxNjZlYzMifX19
ob_car:
type: item
material: howl_pottery_sherd
display name: <&f>Обертка «Машинка»
flags:
ob: eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvOTMxODI4OWM1Yjc1MTFmNzc5YzdiMzQ0ZTRjZTc2NjFiNGU0ODgxMWE5YzI0YmZkOTBlZjdkY2I3NjIwODI4NCJ9fX0=
ob_grinch:
type: item
material: danger_pottery_sherd
display name: <&f>Обертка «Гринч»
flags:
ob: eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvNDUzNjhmNTYzNWZmNmMzNDA3ZjBmMzU2YzViNmUwOTQ3YmNkNWUzODQ5MGM5YWE4YjhiNTgyYTRmMjFhZTNjYiJ9fX0=
ob_heart:
type: item
material: heart_pottery_sherd
display name: <&f>Обертка «Любовь»
flags:
ob: eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvNDdmNDgxYTBiMDg3NmQxNDJjMDNiOGE1NTEwZjVmMDE0NTRkMjhkY2ZlYzlmNTFiM2E0YTFlMmY5NzU5YTIyOSJ9fX0=
ob_diamond:
type: item
material: prize_pottery_sherd
display name: <&f>Обертка «Алмаз»
flags:
ob: eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvOWRkODY3M2Y4NDJlNTBmMTMxYjM3N2M4NGI2ZmU1MWMyMTkxMDZkZjNmYmMwOTFhN2JjOTI2OWI5MWM2NjA1MiJ9fX0=
ob_happynew:
type: item
material: friend_pottery_sherd
display name: <&f>Обертка «Новогоднее настроение»
flags:
ob: eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvZmYzMGI3ZTIwNmNlYjQxYWQzNDg2Yzc5NmZmYjI2MzVkZTQwM2E1YmMwOGZkM2M4NjE0MWI2ZGM0YjEzY2I1In19fQ==
present_ent:
type: entity
entity_type: item_display[item=player_head[skull_skin=eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvYzZlNjliMWM3ZTY5YmNkNDllZDk3NGY1YWMzNmVhMjc1ZWZhYmI4YzY0OWNiMmIxZmU5ZDZlYTYxNjZlYzMifX19]]
giftskin_cmd:
type: command
name: giftskin
description: Does something
usage: /giftskin
permission: plus
tab completions:
1: ! Код головы
script:
- if <player.item_in_hand.advanced_matches[present_item].not>:
- narrate '<&c>Возьмите в руку подарок!'
- stop
- if <context.args.get[1]||null> == null:
- narrate '<&c>Укажите код головы!'
- stop
- inventory adjust slot:hand skull_skin:<context.args.get[1]>
- narrate '<&a>Код головы был изменен!'
presents_handler:
type: world
events:
on player right clicks block:
- define ent <player.eye_location.ray_trace_target[entities=present_ent;blocks=true;range=1.5;raysize=0.7].if_null[null]>
- if <[ent]> != null:
- stop if:<player.item_in_hand.advanced_matches[present_item]>
- stop if:<[ent].has_flag[anim]>
- if <player.item_in_hand.advanced_matches[air]>:
- if <[ent].has_flag[items]>:
- give <item[present_item].with_flag[items:<[ent].flag[items]>].with[skull_skin=<[ent].flag[ob]||eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvYzZlNjliMWM3ZTY5YmNkNDllZDk3NGY1YWMzNmVhMjc1ZWZhYmI4YzY0OWNiMmIxZmU5ZDZlYTYxNjZlYzMifX19>]>
- else:
- give <item[present_item].with[skull_skin=<[ent].flag[ob]||eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvYzZlNjliMWM3ZTY5YmNkNDllZDk3NGY1YWMzNmVhMjc1ZWZhYmI4YzY0OWNiMmIxZmU5ZDZlYTYxNjZlYzMifX19>]>
- playeffect effect:poof <[ent].location.sub[0,0.8,0]> quantity:4 offset:0.1
- playsound sound:ITEM_ARMOR_EQUIP_GENERIC <player.location>
- animate <player> animation:ARM_SWING
- remove <[ent]>
- stop
- if <player.item_in_hand.advanced_matches[ob*]>:
- flag <[ent]> ob:<player.item_in_hand.flag[ob]>
- adjust <[ent]> item:<item[player_head].with[skull_skin=<player.item_in_hand.flag[ob]>]>
- playeffect effect:poof <[ent].location.sub[0,0.8,0]> quantity:4 offset:0.1
- playsound sound:item_armor_equip_leather <player.location>
- take iteminhand
- stop
- determine passively cancelled
- if <[ent].flag[items_count]> >= 15:
- actionbar '<&c>Лимит предметов в подарке 15!'
- stop
- define item <player.item_in_hand>
- adjust <player> item_in_hand:air
- animate <player> animation:ARM_SWING
- flag <[ent]> items:->:<[item]>
- flag <[ent]> items_count:++
- playsound sound:item_armor_equip_leather <player.location>
- adjust <[ent]> interpolation_duration:5t
- adjust <[ent]> interpolation_start:0t
- adjust <[ent]> left_rotation:<location[0,0.1,0.1].to_axis_angle_quaternion[<element[5]>]>
- wait 5t
- adjust <[ent]> interpolation_duration:5t
- adjust <[ent]> interpolation_start:0t
- adjust <[ent]> left_rotation:<location[0,0,-0.1].to_axis_angle_quaternion[<element[0]>]>
on player right clicks block with:present_item:
- determine passively cancelled
- if <context.relative.sub[<context.location>].y> == 1 && <player.cursor_on[5].material.advanced_matches[snow|*_carpet|lantern|brewing_stand|flower_pot|*_banner|potted_*|*_button|sea_pickle|*_sign|tripwire_hook|*_candle|candle|lever|player_head].not>:
- define true <player.item_in_hand.has_flag[items]>
- define item <player.item_in_hand.flag[items]>
- playsound sound:ITEM_ARMOR_EQUIP_GENERIC <player.location>
- spawn present_ent[item=<player.item_in_hand>] <player.eye_location.ray_trace[range=5].add[0,0.5,0]> save:beb
- look <entry[beb].spawned_entity> yaw:<player.eye_location.yaw>
- define ent <entry[beb].spawned_entity>
- flag <[ent]> ob:<player.item_in_hand.skull_skin>
- take iteminhand quantity:1
- flag <[ent]> anim expire:17t
- playeffect effect:poof <[ent].location.sub[0,0.8,0]> quantity:4 offset:0.1
- adjust <[ent]> interpolation_duration:5t
- adjust <[ent]> interpolation_start:0t
- adjust <[ent]> left_rotation:<location[0,1,0.1].to_axis_angle_quaternion[<element[260]>]>
- repeat 2:
- playsound sound:entity_cow_step <[ent].location>
- wait 2.5t
- adjust <[ent]> interpolation_duration:5t
- adjust <[ent]> interpolation_start:0t
- adjust <[ent]> left_rotation:<location[0,1,-0.2].to_axis_angle_quaternion[<element[520]>]>
- repeat 2:
- playsound sound:entity_cow_step <[ent].location>
- wait 2.5t
- adjust <[ent]> interpolation_duration:5t
- adjust <[ent]> interpolation_start:0t
- adjust <[ent]> left_rotation:<location[0,1,0].to_axis_angle_quaternion[<element[0]>]>
- repeat 2:
- playsound sound:entity_cow_step <[ent].location>
- wait 2.5t
- if <[true]>:
- define location <[ent].location.sub[0,0.3,0]>
- playsound sound:entity_firework_rocket_blast_far <[location]> volume:8 pitch:1.5
- playsound sound:entity_firework_rocket_large_blast <[location]> volume:8 pitch:1.5
- playsound sound:entity_firework_rocket_twinkle <[location]> volume:8 pitch:1.5
- playsound sound:entity_firework_rocket_blast <[location]> volume:8 pitch:1.5
- playeffect effect:explosion at:<[location]> visibility:100 offset:0
- repeat 100:
- playeffect effect:firework at:<[location]> visibility:100 offset:0 velocity:<location[0,0,0].random_offset[1].normalize.mul[0.75]>
- playeffect effect:poof at:<[location]> visibility:100 offset:0 velocity:<location[0,0,0].random_offset[1].normalize.mul[0.5]>
- foreach <[item]>:
- drop <[value]> quantity:1 <[ent].location>
- remove <[ent]>