Date: 2023/09/12 06:54:52 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
bonsai_pot:
type: item
debug: false
material: paper
display name: <&f>Pot de bonsai
lore:
- <empty>
- <&f>Placer une terre
- <&f>une pousse d'arbre
- <&f>pour commencer la culture
- <empty>
mechanisms:
custom_model_data: 10205
dirt_bonsai_pot:
type: entity
debug: false
entity_type: block_display
mechanisms:
material: dirt
scale: 0.74,0.3,0.74
sapling_bonsai_pot:
type: entity
debug: false
entity_type: item_display
mechanisms:
item: oak_sapling
scale: 0,0,0
bonsai_pot_event:
type: world
Debug: true
events:
on player right clicks block with:bonsai_pot:
- if <placeholder[superior_island_location_is_member]> matches yes:
- if <context.location.advanced_matches[air]>:
- determine cancelled
- if <context.location.above.advanced_matches[air]>:
- ratelimit <player> 5t
- take iteminhand quantity:1
- worldedit paste file:../../WorldEdit/schematics/bonsai_pot position:<context.location.above> noair
- playsound <player.location> sound:block_wood_place
- flag <context.location.above> bonsai_pot
on player breaks block location_flagged:bonsai_pot:
- if <placeholder[superior_island_location_is_member]> matches yes:
- flag <context.location> bonsai_pot:!
- drop <context.location> bonsai_pot
- if <context.location.has_flag[dirtOn]>:
- drop <context.location> dirt
- remove <context.location.flag[dirtOn]>
- flag <context.location> dirtOn:!
- if <context.location.has_flag[saplingOn]>:
- drop <context.location> <context.location.flag[saplingType]>
- remove <context.location.flag[saplingOn]>
- flag <context.location> saplingType:!
- flag server bonsai_pots:<-:<context.location>
- flag <context.location> bonsai_rdy:!
- determine cancelled
on player right clicks block location_flagged:bonsai_pot:
- determine passively cancelled
- if <player.item_in_hand.advanced_matches[dirt]>:
- if <context.location.has_flag[dirtOn].not>:
- take iteminhand quantity:1
- playsound <player> sound:block_grass_place
- spawn dirt_bonsai_pot <context.location.center.add[-0.37,-0.4,-0.37]> save:dirt
- flag <context.location> dirtOn:<entry[dirt].spawned_entity>
- stop
- if <player.item_in_hand.advanced_matches[*_sapling]>:
- if <context.location.has_flag[dirtOn]>:
- if <context.location.has_flag[saplingOn]>:
- remove <context.location.flag[saplingOn]>
- drop <context.location> <context.location.flag[saplingType]>
- flag <context.location> saplingType:<player.item_in_hand.material.name>
- flag <context.location> saplingMaterial:<context.location.flag[saplingType].before[_sapling]>
- take iteminhand quantity:1
- spawn sapling_bonsai_pot <context.location.center.add[0,-0.09,0]> save:sapling
- define sapling <entry[sapling].spawned_entity>
- flag <context.location> saplingOn:<[sapling]>
- define saplingType <context.location.flag[saplingType]>
- adjust <[sapling]> interpolation_duration:0t
- adjust <[sapling]> interpolation_start:0
- adjust <[sapling]> scale:0,0,0
- adjust <[sapling]> translation:0,0,0
- playsound <player> sound:block_cherry_sapling_place
- adjust <[sapling]> item:<context.location.flag[saplingType]>
- adjust <[sapling]> interpolation_duration:10s
- adjust <[sapling]> interpolation_start:0
- adjust <[sapling]> scale:0.8,0.8,0.8
- adjust <[sapling]> translation:0,0.4,0
- wait 10s
- if <[saplingType]> == <context.location.flag[saplingType]>:
- if <context.location.below.advanced_matches[chest]>:
- if <context.location.has_flag[dirtOn]> && <context.location.has_flag[saplingOn]> && <context.location.has_flag[saplingMaterial]>:
- if <context.location.flag[saplingMaterial]> == oak || dark_oak:
- if <context.location.below.inventory.can_fit[<list[oak_log|oak_leaves|stick|apple]>].quantity[1]>:
- give <list[<context.location.flag[saplingMaterial]>_log|<context.location.flag[saplingMaterial]>_leaves|stick|apple]> to:<context.location.below.inventory>
- else:
- playeffect at:<context.location.center> effect:villager_angry quantity:1 offset:0
- if <context.location.flag[saplingMaterial]> == spruce || birch || jungle || acacia || cherry:
- if <context.location.below.inventory.can_fit[<list[spruce_log|spruce_leaves|stick]>].quantity[1]>:
- give <list[<context.location.flag[saplingMaterial]>_log|<context.location.flag[saplingMaterial]>_leaves|stick]> to:<context.location.below.inventory>
- else:
- playeffect at:<context.location.center> effect:villager_angry quantity:1 offset:0
- else:
- playeffect at:<context.location.center> effect:villager_angry quantity:1 offset:0
- flag server bonsai_pots:->:<context.location>
- if <player.is_sneaking>:
- if <context.location.has_flag[saplingOn]>:
- playsound <player> sound:block_cherry_sapling_break
- remove <context.location.flag[saplingOn]>
- drop <context.location> <context.location.flag[saplingType]>
- flag <context.location> saplingOn:!
- flag <context.location> saplingType:!
- flag server bonsai_pots:<-:<context.location>
- stop
- if <context.location.has_flag[dirtOn]>:
- playsound <player> sound:block_grass_break
- remove <context.location.flag[DirtOn]>
- drop <context.location> dirt
- flag <context.location> dirtOn:!
- flag server bonsai_pots:<-:<context.location>
- stop
on player right clicks chest with:bonsai_pot:
- determine cancelled
on system time secondly every:10:
- foreach <server.flag[bonsai_pots]> as:bonsai:
- if <[bonsai].has_flag[saplingOn]>:
- define saplingType <[bonsai].flag[saplingType]>
- define sapling <[bonsai].flag[saplingOn]>
- adjust <[sapling]> interpolation_duration:0t
- adjust <[sapling]> interpolation_start:0
- adjust <[sapling]> scale:0,0,0
- adjust <[sapling]> translation:0,0,0
- wait 1s
- adjust <[sapling]> interpolation_duration:9s
- adjust <[sapling]> interpolation_start:0
- adjust <[sapling]> scale:0.8,0.8,0.8
- adjust <[sapling]> translation:0,0.4,0
- wait 9s
- if <[bonsai].below.advanced_matches[chest]>:
- if <[bonsai].has_flag[dirtOn]> && <[bonsai].has_flag[saplingOn]> && <[bonsai].has_flag[saplingMaterial]>:
- if <[bonsai].flag[saplingMaterial]> == oak || dark_oak:
- if <[bonsai].below.inventory.can_fit[<list[oak_log|oak_leaves|stick|apple]>].quantity[1]>:
- give <list[<[bonsai].flag[saplingMaterial]>_log|<[bonsai].flag[saplingMaterial]>_leaves|stick|apple]> to:<[bonsai].below.inventory>
- else:
- playeffect at:<[bonsai].center> effect:villager_angry quantity:1 offset:0
- else:
- if <[bonsai].below.inventory.can_fit[<list[spruce_log|spruce_leaves|stick]>].quantity[1]>:
- give <list[<[bonsai].flag[saplingMaterial]>_log|<[bonsai].flag[saplingMaterial]>_leaves|stick]> to:<[bonsai].below.inventory>
- else:
- playeffect at:<[bonsai].center> effect:villager_angry quantity:1 offset:0
- else:
- playeffect at:<[bonsai].center> effect:villager_angry quantity:1 offset:0