-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathentity_hitbox.jmc
264 lines (264 loc) · 9.22 KB
/
entity_hitbox.jmc
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
class entity_hitbox {
function allay() {
data::entity_half_width = 0.175;
data::entity_height = 0.6;
}
function armadillo() {
data::entity_half_width = 0.35;
data::entity_height = 0.65;
}
function armor_stand() {
data::EntityTag = @s::;
if (data storage retina:data EntityTag{Small: 1b}) {
data:: += {entity_half_width: 0.125, entity_height: 0.9875};
}
if (!data storage retina:data EntityTag{Small: 1b}) {
data:: += {entity_half_width: 0.25, entity_height: 1.975};
}
if (data storage retina:data EntityTag{Marker: 1b}) {
data:: += {entity_half_width: 0.0, entity_height: 0.0};
}
}
function axolotl() {
data::entity_half_width = 0.375;
data::entity_height = 0.42;
}
function bat_like() {
data::entity_half_width = 0.45;
data::entity_height = 1.4;
}
function bee() {
data::entity_half_width = 0.3;
data::entity_height = 0.7;
}
function boat() {
data::entity_half_width = 0.6875;
data::entity_height = 0.5625;
}
function camel() {
data::entity_half_width = 0.85;
data::entity_height = 2.375;
}
function cat_like() {
data::entity_half_width = 0.3;
data::entity_height = 0.7;
}
function cave_spider() {
data::entity_half_width = 0.35;
data::entity_height = 0.5;
}
function chicken() {
data::entity_half_width = 0.2;
data::entity_height = 0.7;
}
function cod() {
data::entity_half_width = 0.25;
data::entity_height = 0.3;
}
function cow() {
data::entity_half_width = 0.45;
data::entity_height = 1.4;
}
function creeper() {
data::entity_half_width = 0.3;
data::entity_height = 1.7;
}
function dolphin() {
data::entity_half_width = 0.45;
data::entity_height = 0.6;
}
function donkey() {
data::entity_half_width = 0.6982422;
data::entity_height = 1.5;
}
function elder_guardian() {
data::entity_half_width = 0.99875;
data::entity_height = 1.9975;
}
function end_crystal() {
data::entity_half_width = 1;
data::entity_height = 2;
}
function enderman() {
data::entity_half_width = 0.3;
data::entity_height = 2.9;
}
function falling_block_like() {
data::entity_half_width = 0.49;
data::entity_height = 0.98;
}
function frog() {
data::entity_half_width = 0.25;
data::entity_height = 0.5;
}
function ghast() {
data::entity_half_width = 2;
data::entity_height = 4;
}
function giant() {
data::entity_half_width = 1.8;
data::entity_height = 12;
}
function guardian() {
data::entity_half_width = 0.425;
data::entity_height = 0.85;
}
function hoglin() {
data::entity_half_width = 0.6982422;
data::entity_height = 1.4;
}
function horse_like() {
data::entity_half_width = 0.6982422;
data::entity_height = 1.6;
}
function iron_golem() {
data::entity_half_width = 0.7;
data::entity_height = 2.7;
}
function item_frame() {
$item_frame_facing = @s::Facing;
switch ($item_frame_facing) {
case 0: data::Surfaces = {Top: [[0.125, 1.0, 0.125, 0.875, 1.0, 0.875]], Bottom: [[0.125, 0.9375, 0.125, 0.875, 0.9375, 0.875]], West: [[0.125, 0.9375, 0.125, 0.125, 1.0, 0.875]], East: [[0.875, 0.9375, 0.125, 0.875, 1.0, 0.875]], North: [[0.125, 0.9375, 0.125, 0.875, 1.0, 0.125]], South: [[0.125, 0.9375, 0.875, 0.875, 1.0, 0.875]]};
case 1: data::Surfaces = {Top: [[0.125, 0.0625, 0.125, 0.875, 0.0625, 0.875]], Bottom: [[0.125, 0.0, 0.125, 0.875, 0.0, 0.875]], West: [[0.125, 0.0, 0.125, 0.125, 0.0625, 0.875]], East: [[0.875, 0.0, 0.125, 0.875, 0.0625, 0.875]], North: [[0.125, 0.0, 0.125, 0.875, 0.0625, 0.125]], South: [[0.125, 0.0, 0.875, 0.875, 0.0625, 0.875]]};
case 2: data::Surfaces = {Top: [[0.125, 0.875, 0.9375, 0.875, 0.875, 1.0]], Bottom: [[0.125, 0.125, 0.9375, 0.875, 0.125, 1.0]], West: [[0.125, 0.125, 0.9375, 0.125, 0.875, 1.0]], East: [[0.875, 0.125, 0.9375, 0.875, 0.875, 1.0]], North: [[0.125, 0.125, 0.9375, 0.875, 0.875, 0.9375]], South: [[0.125, 0.125, 1.0, 0.875, 0.875, 1.0]]};
case 3: data::Surfaces = {Top: [[0.125, 0.875, 0.0, 0.875, 0.875, 0.0625]], Bottom: [[0.125, 0.125, 0.0, 0.875, 0.125, 0.0625]], West: [[0.125, 0.125, 0.0, 0.125, 0.875, 0.0625]], East: [[0.875, 0.125, 0.0, 0.875, 0.875, 0.0625]], North: [[0.125, 0.125, 0.0, 0.875, 0.875, 0.0]], South: [[0.125, 0.125, 0.0625, 0.875, 0.875, 0.0625]]};
case 4: data::Surfaces = {Top: [[0.9375, 0.875, 0.125, 1.0, 0.875, 0.875]], Bottom: [[0.9375, 0.125, 0.125, 1.0, 0.125, 0.875]], West: [[0.9375, 0.125, 0.125, 0.9375, 0.875, 0.875]], East: [[1.0, 0.125, 0.125, 1.0, 0.875, 0.875]], North: [[0.9375, 0.125, 0.125, 1.0, 0.875, 0.125]], South: [[0.9375, 0.125, 0.875, 1.0, 0.875, 0.875]]};
case 5: data::Surfaces = {Top: [[0.0, 0.875, 0.125, 0.0625, 0.875, 0.875]], Bottom: [[0.0, 0.125, 0.125, 0.0625, 0.125, 0.875]], West: [[0.0, 0.125, 0.125, 0.0, 0.875, 0.875]], East: [[0.0625, 0.125, 0.125, 0.0625, 0.875, 0.875]], North: [[0.0, 0.125, 0.125, 0.0625, 0.875, 0.125]], South: [[0.0, 0.125, 0.875, 0.0625, 0.875, 0.875]]};
}
}
function leash_knot() {
data::entity_half_width = 0.1875;
data::entity_height = 0.5;
}
function llama() {
data::entity_half_width = 0.45;
data::entity_height = 1.87;
}
function minecart() {
data::entity_half_width = 0.49;
data::entity_height = 0.7;
}
function panda() {
data::entity_half_width = 0.65;
data::entity_height = 1.25;
}
function phantom() {
data::entity_half_width = 0.45;
data::entity_height = 0.5;
}
function pig() {
data::entity_half_width = 0.45;
data::entity_height = 0.9;
}
function player_like() {
data::entity_half_width = 0.3;
data::entity_height = 1.8;
$check_for_head = true;
$head_Y = EVAL(1.3 * SCALE);
}
function polar_bear() {
data::entity_half_width = 0.7;
data::entity_height = 1.4;
}
function pufferfish() {
$pufferfish_puffstate = @s::PuffState;
if ($pufferfish_puffstate == 0) {
data:: += {entity_half_width: 0.175, entity_height: 0.35};
}
if ($pufferfish_puffstate == 1) {
data:: += {entity_half_width: 0.25, entity_height: 0.5};
}
if ($pufferfish_puffstate == 2) {
data:: += {entity_half_width: 0.35, entity_height: 0.7};
}
}
function rabbit() {
data::entity_half_width = 0.2;
data::entity_height = 0.5;
}
function ravager() {
data::entity_half_width = 0.975;
data::entity_height = 2;
}
function salmon() {
data::entity_half_width = 0.35;
data::entity_height = 0.4;
}
function sheep_like() {
data::entity_half_width = 0.45;
data::entity_height = 1.3;
}
function shulker() {
// TODO: take peek/rotation into account and move this to the end of get_hitbox.entity(), along with item frames and paintings maybe
data::entity_half_width = 0.5;
data::entity_height = 1;
}
function skeleton() {
data::entity_half_width = 0.3;
data::entity_height = 1.98958333334;
}
function slime_like() {
$slime_size = @s::Size;
$slime_size ++;
data::entity_half_width = 0.255 * (float) $slime_size;
data::entity_height = 0.510 * (float) $slime_size;
}
function small_arthropod() {
data::entity_half_width = 0.2;
data::entity_height = 0.3;
}
function sniffer() {
data::entity_half_width = 0.95;
data::entity_height = 1.75;
}
function snow_golem() {
data::entity_half_width = 0.35;
data::entity_height = 1.9;
}
function spider() {
data::entity_half_width = 0.7;
data::entity_height = 0.9;
}
function squid() {
data::entity_half_width = 0.4;
data::entity_height = 0.8;
}
function strider() {
data::entity_half_width = 0.45;
data::entity_height = 1.7;
}
function tropical_fish() {
data::entity_half_width = 0.25;
data::entity_height = 0.4;
}
function turtle() {
data::entity_half_width = 0.6;
data::entity_height = 0.4;
}
function vex() {
data::entity_half_width = 0.2;
data::entity_height = 0.8;
}
function warden() {
data::entity_half_width = 0.45;
data::entity_height = 2.9;
}
function wither() {
data::entity_half_width = 0.45;
data::entity_height = 3.5;
}
function wither_skeleton() {
data::entity_half_width = 0.35;
data::entity_height = 2.4;
}
function wolf() {
data::entity_half_width = 0.3;
data::entity_height = 0.85;
}
function zombie_like() {
data::entity_half_width = 0.3;
data::entity_height = 1.95;
$check_for_head = true;
$head_Y = EVAL(1.45 * SCALE);
}
}