Date: 2020/05/20 11:32:43 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
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
thebucket:
type: item
material: bucket
display name: "<&e>Bucket"
lore:
- <&f>Dear god...
BucketStop:
type: world
debug: false
events:
on player starts sneaking:
- flag <player> Sucking:!
on player left clicks:
- flag <player> Sucking:!
on player picks up item:
- if <player.has_flag[sucking]>:
- determine cancelled
on player fills thebucket:
- determine cancelled
on player empties thebucket:
- determine cancelled
on entity damaged by thorns:
- if <context.damager.location.distance[<context.entity.location>]> >= 4.5:
- determine cancelled
on thebucket despawns:
- determine cancelled
BucketProjectile:
type: world
debug: false
events:
on player picks up item:
- if <server.flag[bucketprojectiles].contains[<context.entity>]>:
- determine cancelled
on tick:
- if <server.flag[bucketprojectiles]||null> != null:
- foreach <server.flag[bucketprojectiles]> as:entity:
- define velocity <[entity].velocity.mul[1.2]>
- define vx <[velocity].x.abs>
- define vy <[velocity].y.abs>
- define vz <[velocity].z.abs>
- define v <[vx].add[<[vy]>].add[<[vz]>]||0>
- define max <[entity].bounding_box.last>
- define min <[entity].bounding_box.first>
- define cuboid <cuboid[<[min]>|<[max]>]>
- define center <[cuboid].center>
- define size1 <[max].sub[<[min]>]>
- define sizex <[size1].x.abs>
- define sizey <[size1].y.abs>
- define sizez <[size1].z.abs>
- define size <[sizex].add[sizey].add[sizez]||0>
- if <[entity].entity_type> == dropped_item:
- define entities <[center].find.entities.within[<[size].mul[8.6]>].exclude[<[entity].flag[shooter].as_entity>]||null>
- else:
- define entities <[center].find.entities.within[<[size].mul[3.6]>].exclude[<[entity].flag[shooter].as_entity>]||null>
- if <[entity].entity_type> == dropped_item:
- define item <[entity].item>
- if <[item].max_durability||null> != null:
- define durability <[item].max_durability>
- if <[durability]> > 500:
- define damage <[v].mul[2.25].mul[<[durability].mul[0.0017]>]>
- else:
- define damage <[v].mul[2.25].mul[<[durability].mul[0.0057]>]>
- else:
- if <[item].material.block_strength||null> != null:
- define strength <[item].material.block_strength>
- if <[strength]> == -1:
- define damage <[v].mul[18278241246]>
- else:
- define damage <[v].mul[2.25].mul[<[strength].mul[0.3]>]>
- else:
- define damage <[v].mul[0.2]>
- else:
- define damage <[v].mul[2.25].mul[<[size].mul[1.2]>]>
- define nearblocks:<[center].find.blocks.within[<[size].mul[1.8]>].filter[<material.block_strength.is[OR_MORE].than[<[damage]>]>]||!>
#- define blocksbroken <[center].find.blocks.within[<[size].mul[2.2]>].filter[<material.name.is[!=].to[air]>].filter[<material.block_strength.is[OR_LESS].than[<[v].mul[1.8].add[<[size].mul[2]>]>]>]>
- if <[v]> >= 0.7 && <[entities].size> > 1:
- hurt <[entities]> <[damage]> source:<[entity].flag[shooter].as_entity>
- if <[nearblocks].size||0> >= 1:
- hurt <[entity]> <[damage]>
#- if <[blocksbroken]||null> != null:
#- foreach <[blocksbroken]> as:block:
#- modifyblock <[block].as_location> air naturally delayed source:<player>
- if <[v]> <= 0.4 || <[entity].is_on_ground> || <[entity]||null> == null || <[size]> == 0:
- flag server bucketprojectiles:<-:<[entity]>
- flag <[entity]> shooter:!
BucketEscape:
type: world
debug: false
events:
on player dies:
- if <player.location.world.name> == bucket:
-
Bucketlocked:
type: world
debug: false
events:
on player changes world:
- if <player.location.world.name> == bucket:
- if <player.has_flag[out].not>:
- flag <player> out:!
- playsound <player.location.above[60]> sound:ENTITY_ZOMBIE_ATTACK_IRON_DOOR pitch:0 volume:5
- playsound <player.location.above[60]> sound:BLOCK_ANVIL_PLACE pitch:0 volume:5
- foreach <server.list_online_players.filter[<inventory.contains.scriptname[thebucket]>]> as:player:
- if <[player]||null> != null:
- playsound <[player].location> sound:ENTITY_ZOMBIE_ATTACK_IRON_DOOR pitch:2 volume:0.2
- playsound <[player].location> sound:BLOCK_ANVIL_PLACE pitch:2 volume:0.2
- playsound <[player].location> sound:BLOCK_NOTE_BLOCK_CHIME pitch:2 volume:0.2
#- narrate "<&e><context.entity.name> is trying to get out!" targets:<[player]>
- determine cancelled
- else:
- flag <player> out:!
- else:
- if <context.destination.world.name> == bucket && <player.location.world.name> != bucket && !<player.has_flag[suckedtp]>:
- determine cancelled
on entity teleports:
- if <context.entity.location.world.name> == bucket:
- if <context.entity.has_flag[out].not> && <context.destination.world.name> != bucket:
- flag <player> out:!
- playsound <player.location.above[60]> sound:ENTITY_ZOMBIE_ATTACK_IRON_DOOR pitch:0 volume:5
- playsound <player.location.above[60]> sound:BLOCK_ANVIL_PLACE pitch:0 volume:5
- foreach <server.list_online_players.filter[<inventory.contains.scriptname[thebucket]>]> as:player:
- if <[player]||null> != null && <context.entity.name||null> != null:
- playsound <[player].location> sound:ENTITY_ZOMBIE_ATTACK_IRON_DOOR pitch:2 volume:0.2
- playsound <[player].location> sound:BLOCK_ANVIL_PLACE pitch:2 volume:0.2
- playsound <[player].location> sound:BLOCK_NOTE_BLOCK_CHIME pitch:2 volume:0.2
#- narrate "<&e><context.entity.name> is trying to get out!" targets:<[player]>
- determine cancelled
- if <context.entity.has_flag[out]>:
- wait 1t
- flag <player> out:!
- else:
- if <context.destination.world.name> == bucket && <context.entity.location.world.name> != bucket && !<context.entity.has_flag[suckedtp]>:
- determine cancelled
BucketFall:
type: world
debug: false
events:
# Event for preventing first fall damage
on entity damaged by fall:
- if <context.entity.has_flag[bucketfall]>:
- flag <context.entity> bucketfall:!
- if <context.entity.world.name> == bucket:
- determine cancelled
# Get entities inside bucket
# For 3 seconds, start sucking entities in front
# Check for 3 second cooldown for unnecesary spam
BucketIn:
type: world
debug: false
events:
on player right clicks with thebucket:
- determine cancelled passively
- if <player.location.world.name> == Bucket:
- playsound <player.location.above[20]> sound:ENTITY_ZOMBIE_ATTACK_IRON_DOOR pitch:0 volume:5
- playsound <player.location.above[20]> sound:BLOCK_ANVIL_PLACE pitch:0 volume:5
- stop
- if !<player.has_flag[Sucking]>:
- run locally BucketSuckEffects speed:0
on tick every:5:
- foreach <server.list_online_players_flagged[Sucking]> as:player:
- if <[player].item_in_hand.script.name||null> != TheBucket:
- flag <[player]> Sucking:!
BucketSuckEffects:
# Effects, start suck and give cooldown/sucking flag
- flag <player> Sucking duration:3s
- while <player.has_flag[Sucking]>:
- run locally BucketSuckTechnical speed:0
- playeffect at:<player.location.above[1.6].forward[1.75]> effect:cloud data:0 quantity:2 offset:0.5,0.5,0.5
- playeffect at:<player.location.above[1.6].forward[2.15]> effect:cloud data:0 quantity:2 offset:0.6,0.6,0.6
- playeffect at:<player.location.above[1.6].forward[2.25]> effect:cloud data:0 quantity:2 offset:0.7,0.7,0.7
- playeffect at:<player.location.above[1.6].forward[2.35]> effect:cloud data:0 quantity:2 offset:0.8,0.8,0.8
- playsound at:<player.location.above[1.6].forward[1.75]> sound:ITEM_BUCKET_FILL
- actionbar "<&6>Entities in bucket: <&e><world[bucket].entities.size>" targets:<player>
- wait 1t
BucketSuckTechnical:
# Define entities within player eye location
- define entitieswithin <player.eye_location.find.entities.within[5].exclude[<player>]>
# Foreach - Check if the player is facing the entities and define them as sucked
# If true, add it to definition entitylist
# If false (no available entities), stop script
- foreach <[entitieswithin]> as:entity:
- if <player.eye_location.facing[<[entity]>].degrees[70,70]>:
- define sucked <[sucked].include[<[entity]>]||<list[<[entity]>]||null>>
- if <[sucked]||null> == null:
- stop
# Foreach - Flag entity as sucked. While flagged, get shot towards player until sucked or 3 sec runs out.
- foreach <[sucked]> as:entity:
- flag <[entity]> sucked duration:6t
- flag <[entity]> suckedtp duration:1.5s
- while <[entity].has_flag[sucked]> && <[entity].location.distance[<player.location>]> >= 1:
- if <[entity].is_projectile>:
- if <[entity].location.distance[<player.location>]> <= 2.4:
- run locally BucketInside speed:0 def:<[entity]>
- else:
- shoot <[entity]> destination:<player.location> speed:1 no_rotate
- wait 5t
- waituntil <[entity].location.distance[<player.location>]> <= 2.4 || !<[entity].has_flag[sucked]>
- if <[entity].location.distance[<player.location>]> <= 2.4:
- run locally BucketInside speed:0 def:<[entity]>
- actionbar "<&6>Entities in bucket: <&e><world[bucket].entities.size>" targets:<player>
- stop
- if !<[entity].has_flag[sucked]>:
- stop
BucketInside:
# Teleport in bucket dimension at spawn chunks and y 333
# Flag to prevent first fall damage with event on damaged by fall
- define entity <[1]>
- playsound <[entity].location> sound:ITEM_BOTTLE_FILL_DRAGONBREATH
- flag <[entity]> bucketfall
- adjust <[entity]> remove_when_far_away:false
- teleport <[entity]> <location[0.5,355,0.5,Bucket]>
- flag <[entity]> sucked:!
BucketOut:
type: world
debug: false
events:
on player left clicks with TheBucket:
- determine cancelled passively
- if <player.location.world.name> == Bucket:
- playsound <player.location.above[20]> sound:ENTITY_ZOMBIE_ATTACK_IRON_DOOR pitch:0 volume:5
- playsound <player.location.above[20]> sound:BLOCK_ANVIL_PLACE pitch:0 volume:5
- stop
- if !<player.has_flag[Sucking]>:
- run locally BucketOutScript speed:0
- run locally BucketOutScript2 speed:0
BucketOutScript:
# Check if empty
- if <world[bucket].entities.is_empty>:
- playsound <player> sound:UI_BUTTON_CLICK
- actionbar "<&c>No entities in the bucket" targets:<player>
- stop
# Some particles and sound
- repeat 5:
- actionbar "<&6>Entities in bucket: <&e><world[bucket].entities.size>" targets:<player>
- playeffect at:<player.location.above[1.6].forward[1.75]> effect:WATER_SPLASH quantity:50 offset:0.3,0.3,0.3
- wait 1t
BucketOutScript2:
# Check if empty
- if <world[bucket].entities.is_empty>:
- playsound <player> sound:UI_BUTTON_CLICK
- actionbar "<&c>No entities in the bucket" targets:<player>
- stop
- playsound <player.location.above[1.6].forward[1.75]> sound:ITEM_BUCKET_EMPTY
# Define random entity to get out
- define entity <world[bucket].entities.random>
# Teleport and shoot
- flag <[entity]> out duration:2s
- adjust <[entity]> fall_distance:0
- if <[entity].is_projectile>:
- shoot <[entity]> origin:<player.eye_location.above[1.6].forward[1.75]> speed:3 shooter:<player>
- else:
- if <[entity].entity_type> != player:
- teleport <[entity]> <player.location.above[1.6].forward[1.75]>
- if <[entity].entity_type> != player:
- adjust <[entity]> velocity:<player.eye_location.direction.vector.mul[3].with_y[<player.eye_location.direction.vector.y.mul[1.5]>]>
- else:
- shoot <[entity]> origin:<player.eye_location.forward[1.75]> speed:3
- flag server bucketprojectiles:->:<[entity]>
- flag <[entity]> shooter:<player>
- wait 1t
- actionbar "<&6>Entities in bucket: <&e><world[bucket].entities.size>" targets:<player>