pumpkin-api-py 0.1.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (108) hide show
  1. componentize_py_async_support/__init__.py +570 -0
  2. componentize_py_async_support/futures.py +149 -0
  3. componentize_py_async_support/streams.py +345 -0
  4. componentize_py_runtime.pyi +40 -0
  5. componentize_py_types.py +32 -0
  6. poll_loop.py +440 -0
  7. pumpkin_api/__init__.py +41 -0
  8. pumpkin_api/build.py +68 -0
  9. pumpkin_api/impl.py +355 -0
  10. pumpkin_api/wit/advancement.wit +41 -0
  11. pumpkin_api/wit/attributes.wit +56 -0
  12. pumpkin_api/wit/bedrock-packets.wit +1709 -0
  13. pumpkin_api/wit/biomes.wit +72 -0
  14. pumpkin_api/wit/block-entity.wit +423 -0
  15. pumpkin_api/wit/boss-bar.wit +83 -0
  16. pumpkin_api/wit/command.wit +244 -0
  17. pumpkin_api/wit/common.wit +261 -0
  18. pumpkin_api/wit/context.wit +61 -0
  19. pumpkin_api/wit/damage-types.wit +57 -0
  20. pumpkin_api/wit/data-components.wit +117 -0
  21. pumpkin_api/wit/datapack.wit +54 -0
  22. pumpkin_api/wit/display.wit +171 -0
  23. pumpkin_api/wit/enchantments.wit +102 -0
  24. pumpkin_api/wit/entity-statuses.wit +68 -0
  25. pumpkin_api/wit/entity-types.wit +164 -0
  26. pumpkin_api/wit/entity.wit +1 -0
  27. pumpkin_api/wit/event.wit +2435 -0
  28. pumpkin_api/wit/forms.wit +51 -0
  29. pumpkin_api/wit/game-events.wit +67 -0
  30. pumpkin_api/wit/game-rules.wit +69 -0
  31. pumpkin_api/wit/gui.wit +39 -0
  32. pumpkin_api/wit/i18n.wit +21 -0
  33. pumpkin_api/wit/inventory.wit +78 -0
  34. pumpkin_api/wit/ipc.wit +7 -0
  35. pumpkin_api/wit/item-stack.wit +104 -0
  36. pumpkin_api/wit/java-dialogs.wit +155 -0
  37. pumpkin_api/wit/java-packets.wit +1838 -0
  38. pumpkin_api/wit/log.wit +14 -0
  39. pumpkin_api/wit/metadata.wit +19 -0
  40. pumpkin_api/wit/particles.wit +131 -0
  41. pumpkin_api/wit/permission.wit +46 -0
  42. pumpkin_api/wit/player.wit +1432 -0
  43. pumpkin_api/wit/plugin.wit +121 -0
  44. pumpkin_api/wit/potions.wit +52 -0
  45. pumpkin_api/wit/recipe.wit +88 -0
  46. pumpkin_api/wit/scheduler.wit +24 -0
  47. pumpkin_api/wit/scoreboard.wit +111 -0
  48. pumpkin_api/wit/screens.wit +31 -0
  49. pumpkin_api/wit/server.wit +286 -0
  50. pumpkin_api/wit/sounds.wit +1987 -0
  51. pumpkin_api/wit/statistics.wit +94 -0
  52. pumpkin_api/wit/status-effect.wit +54 -0
  53. pumpkin_api/wit/text.wit +68 -0
  54. pumpkin_api/wit/uuid.wit +16 -0
  55. pumpkin_api/wit/world.wit +1050 -0
  56. pumpkin_api_py-0.1.0.dist-info/METADATA +53 -0
  57. pumpkin_api_py-0.1.0.dist-info/RECORD +108 -0
  58. pumpkin_api_py-0.1.0.dist-info/WHEEL +4 -0
  59. pumpkin_api_py-0.1.0.dist-info/entry_points.txt +2 -0
  60. pumpkin_api_py-0.1.0.dist-info/licenses/LICENSE-APACHE +176 -0
  61. pumpkin_api_py-0.1.0.dist-info/licenses/LICENSE-MIT +21 -0
  62. wit_world/__init__.py +114 -0
  63. wit_world/exports/__init__.py +19 -0
  64. wit_world/exports/metadata.py +24 -0
  65. wit_world/imports/__init__.py +0 -0
  66. wit_world/imports/advancement.py +56 -0
  67. wit_world/imports/attributes.py +66 -0
  68. wit_world/imports/bedrock_packets.py +2413 -0
  69. wit_world/imports/biomes.py +81 -0
  70. wit_world/imports/block_entity.py +1353 -0
  71. wit_world/imports/boss_bar.py +137 -0
  72. wit_world/imports/command.py +705 -0
  73. wit_world/imports/common.py +335 -0
  74. wit_world/imports/context.py +91 -0
  75. wit_world/imports/damage_types.py +66 -0
  76. wit_world/imports/data_components.py +126 -0
  77. wit_world/imports/datapack.py +124 -0
  78. wit_world/imports/display.py +295 -0
  79. wit_world/imports/enchantments.py +129 -0
  80. wit_world/imports/entity_statuses.py +77 -0
  81. wit_world/imports/entity_types.py +173 -0
  82. wit_world/imports/event.py +3558 -0
  83. wit_world/imports/forms.py +98 -0
  84. wit_world/imports/game_events.py +76 -0
  85. wit_world/imports/game_rules.py +88 -0
  86. wit_world/imports/gui.py +81 -0
  87. wit_world/imports/i18n.py +35 -0
  88. wit_world/imports/inventory.py +159 -0
  89. wit_world/imports/ipc.py +20 -0
  90. wit_world/imports/item_stack.py +206 -0
  91. wit_world/imports/java_dialogs.py +208 -0
  92. wit_world/imports/java_packets.py +3560 -0
  93. wit_world/imports/logging.py +30 -0
  94. wit_world/imports/particles.py +140 -0
  95. wit_world/imports/permission.py +71 -0
  96. wit_world/imports/player.py +1753 -0
  97. wit_world/imports/potions.py +61 -0
  98. wit_world/imports/recipe.py +120 -0
  99. wit_world/imports/scheduler.py +44 -0
  100. wit_world/imports/scoreboard.py +167 -0
  101. wit_world/imports/screens.py +40 -0
  102. wit_world/imports/server.py +493 -0
  103. wit_world/imports/sounds.py +1996 -0
  104. wit_world/imports/statistics.py +103 -0
  105. wit_world/imports/status_effect.py +63 -0
  106. wit_world/imports/text.py +156 -0
  107. wit_world/imports/uuid.py +36 -0
  108. wit_world/imports/world.py +1640 -0
@@ -0,0 +1,72 @@
1
+ package pumpkin:plugin@0.1.0;
2
+
3
+ interface biomes {
4
+ enum biome {
5
+ badlands,
6
+ bamboo-jungle,
7
+ basalt-deltas,
8
+ beach,
9
+ birch-forest,
10
+ cherry-grove,
11
+ cold-ocean,
12
+ crimson-forest,
13
+ dark-forest,
14
+ deep-cold-ocean,
15
+ deep-dark,
16
+ deep-frozen-ocean,
17
+ deep-lukewarm-ocean,
18
+ deep-ocean,
19
+ desert,
20
+ dripstone-caves,
21
+ end-barrens,
22
+ end-highlands,
23
+ end-midlands,
24
+ eroded-badlands,
25
+ flower-forest,
26
+ forest,
27
+ frozen-ocean,
28
+ frozen-peaks,
29
+ frozen-river,
30
+ grove,
31
+ ice-spikes,
32
+ jagged-peaks,
33
+ jungle,
34
+ lukewarm-ocean,
35
+ lush-caves,
36
+ mangrove-swamp,
37
+ meadow,
38
+ mushroom-fields,
39
+ nether-wastes,
40
+ ocean,
41
+ old-growth-birch-forest,
42
+ old-growth-pine-taiga,
43
+ old-growth-spruce-taiga,
44
+ pale-garden,
45
+ plains,
46
+ river,
47
+ savanna,
48
+ savanna-plateau,
49
+ small-end-islands,
50
+ snowy-beach,
51
+ snowy-plains,
52
+ snowy-slopes,
53
+ snowy-taiga,
54
+ soul-sand-valley,
55
+ sparse-jungle,
56
+ stony-peaks,
57
+ stony-shore,
58
+ sulfur-caves,
59
+ sunflower-plains,
60
+ swamp,
61
+ taiga,
62
+ the-end,
63
+ the-void,
64
+ warm-ocean,
65
+ warped-forest,
66
+ windswept-forest,
67
+ windswept-gravelly-hills,
68
+ windswept-hills,
69
+ windswept-savanna,
70
+ wooded-badlands,
71
+ }
72
+ }
@@ -0,0 +1,423 @@
1
+ interface block-entity {
2
+ use common.{block-pos, nbt-tree};
3
+ use item-stack.{item-stack};
4
+ use inventory.{inventory};
5
+
6
+ resource block-entity {
7
+ resource-location: func() -> string;
8
+ get-position: func() -> block-pos;
9
+ get-id: func() -> u32;
10
+ is-dirty: func() -> bool;
11
+ clear-dirty: func();
12
+
13
+ /// Sets a namespaced custom data value on this block entity.
14
+ set-custom-data: func(namespace: string, key: string, value: nbt-tree);
15
+ /// Returns a namespaced custom data value from this block entity, if set.
16
+ get-custom-data: func(namespace: string, key: string) -> option<nbt-tree>;
17
+ /// Removes a namespaced custom data value from this block entity.
18
+ remove-custom-data: func(namespace: string, key: string);
19
+ /// Returns whether this block entity has a namespaced custom data value.
20
+ has-custom-data: func(namespace: string, key: string) -> bool;
21
+ }
22
+
23
+ resource container-block-entity {
24
+ get-block-entity: func() -> block-entity;
25
+ /// Returns the generic inventory handle for this container.
26
+ get-inventory: func() -> inventory;
27
+ get-size: func() -> u32;
28
+ is-empty: func() -> bool;
29
+ get-stack: func(slot: u32) -> option<item-stack>;
30
+ set-stack: func(slot: u32, stack: option<item-stack>);
31
+ remove-stack: func(slot: u32) -> option<item-stack>;
32
+ clear: func();
33
+ }
34
+
35
+ resource command-block-entity {
36
+ get-block-entity: func () -> block-entity;
37
+ last-output: func() -> string;
38
+ track-output: func() -> bool;
39
+ success-count: func() -> u32;
40
+ command: func() -> string;
41
+ auto: func() -> bool;
42
+ condition-met: func() -> bool;
43
+ powered: func() -> bool;
44
+ }
45
+
46
+ enum dye-color {
47
+ white,
48
+ orange,
49
+ magenta,
50
+ light-blue,
51
+ yellow,
52
+ lime,
53
+ pink,
54
+ gray,
55
+ light-gray,
56
+ cyan,
57
+ purple,
58
+ blue,
59
+ brown,
60
+ green,
61
+ red,
62
+ black,
63
+ }
64
+
65
+ record sign-text {
66
+ messages: list<string>,
67
+ color: dye-color,
68
+ has-glowing-text: bool,
69
+ }
70
+
71
+ resource sign-block-entity {
72
+ get-block-entity: func() -> block-entity;
73
+ get-front-text: func() -> sign-text;
74
+ set-front-text: func(text: sign-text);
75
+ get-back-text: func() -> sign-text;
76
+ set-back-text: func(text: sign-text);
77
+ is-waxed: func() -> bool;
78
+ set-waxed: func(waxed: bool);
79
+ }
80
+
81
+ resource jukebox-block-entity {
82
+ get-block-entity: func() -> block-entity;
83
+ get-container: func() -> container-block-entity;
84
+ is-playing: func() -> bool;
85
+ stop-playing: func();
86
+ start-playing: func(length-in-ticks: u64);
87
+ }
88
+
89
+ resource chest-block-entity {
90
+ get-block-entity: func() -> block-entity;
91
+ get-container: func() -> container-block-entity;
92
+ viewer-count: func() -> u32;
93
+ }
94
+
95
+ resource mob-spawner-block-entity {
96
+ get-block-entity: func() -> block-entity;
97
+ get-spawn-count: func() -> s32;
98
+ get-spawn-range: func() -> s32;
99
+ get-delay: func() -> s32;
100
+ }
101
+
102
+ resource map-block-entity {
103
+ get-block-entity: func() -> block-entity;
104
+ get-map-id: func() -> s32;
105
+ set-map-id: func(map-id: s32);
106
+ get-colors: func() -> list<u8>;
107
+ set-colors: func(colors: list<u8>);
108
+ set-pixel: func(x: u32, y: u32, color: u8);
109
+ get-pixel: func(x: u32, y: u32) -> u8;
110
+ update: func();
111
+ stream-frame: func(frame-data: list<u8>);
112
+ }
113
+
114
+ resource hanging-sign-block-entity {
115
+ get-block-entity: func() -> block-entity;
116
+ get-front-text: func() -> sign-text;
117
+ set-front-text: func(text: sign-text);
118
+ get-back-text: func() -> sign-text;
119
+ set-back-text: func(text: sign-text);
120
+ is-waxed: func() -> bool;
121
+ set-waxed: func(waxed: bool);
122
+ }
123
+
124
+ resource trapped-chest-block-entity {
125
+ get-block-entity: func() -> block-entity;
126
+ get-container: func() -> container-block-entity;
127
+ viewer-count: func() -> u32;
128
+ }
129
+
130
+ resource banner-block-entity {
131
+ get-block-entity: func() -> block-entity;
132
+ get-custom-name: func() -> option<string>;
133
+ }
134
+
135
+ resource barrel-block-entity {
136
+ get-block-entity: func() -> block-entity;
137
+ get-container: func() -> container-block-entity;
138
+ viewer-count: func() -> u32;
139
+ }
140
+
141
+ resource beacon-block-entity {
142
+ get-block-entity: func() -> block-entity;
143
+ get-container: func() -> container-block-entity;
144
+ get-primary-effect: func() -> s32;
145
+ get-secondary-effect: func() -> s32;
146
+ get-levels: func() -> s32;
147
+ }
148
+
149
+ resource bed-block-entity {
150
+ get-block-entity: func() -> block-entity;
151
+ }
152
+
153
+ resource beehive-block-entity {
154
+ get-block-entity: func() -> block-entity;
155
+ get-bee-count: func() -> u32;
156
+ }
157
+
158
+ resource bell-block-entity {
159
+ get-block-entity: func() -> block-entity;
160
+ is-ringing: func() -> bool;
161
+ get-ring-ticks: func() -> s32;
162
+ }
163
+
164
+ resource blasting-furnace-block-entity {
165
+ get-block-entity: func() -> block-entity;
166
+ get-container: func() -> container-block-entity;
167
+ get-cooking-time-spent: func() -> u16;
168
+ get-cooking-total-time: func() -> u16;
169
+ get-lit-time-remaining: func() -> u16;
170
+ get-lit-total-time: func() -> u16;
171
+ is-burning: func() -> bool;
172
+ }
173
+
174
+ resource brewing-stand-block-entity {
175
+ get-block-entity: func() -> block-entity;
176
+ get-container: func() -> container-block-entity;
177
+ get-brew-time: func() -> s32;
178
+ get-fuel: func() -> s32;
179
+ }
180
+
181
+ resource brushable-block-block-entity {
182
+ get-block-entity: func() -> block-entity;
183
+ }
184
+
185
+ resource calibrated-sculk-sensor-block-entity {
186
+ get-block-entity: func() -> block-entity;
187
+ }
188
+
189
+ resource campfire-block-entity {
190
+ get-block-entity: func() -> block-entity;
191
+ get-container: func() -> container-block-entity;
192
+ }
193
+
194
+ resource chiseled-bookshelf-block-entity {
195
+ get-block-entity: func() -> block-entity;
196
+ get-container: func() -> container-block-entity;
197
+ get-last-interacted-slot: func() -> s8;
198
+ }
199
+
200
+ resource comparator-block-entity {
201
+ get-block-entity: func() -> block-entity;
202
+ get-output-signal: func() -> u8;
203
+ }
204
+
205
+ resource conduit-block-entity {
206
+ get-block-entity: func() -> block-entity;
207
+ }
208
+
209
+ resource copper-golem-statue-block-entity {
210
+ get-block-entity: func() -> block-entity;
211
+ }
212
+
213
+ resource crafter-block-entity {
214
+ get-block-entity: func() -> block-entity;
215
+ get-container: func() -> container-block-entity;
216
+ get-crafting-ticks-remaining: func() -> s32;
217
+ is-triggered: func() -> bool;
218
+ }
219
+
220
+ resource creaking-heart-block-entity {
221
+ get-block-entity: func() -> block-entity;
222
+ get-creaking-uuid: func() -> option<string>;
223
+ }
224
+
225
+ resource daylight-detector-block-entity {
226
+ get-block-entity: func() -> block-entity;
227
+ }
228
+
229
+ resource decorated-pot-block-entity {
230
+ get-block-entity: func() -> block-entity;
231
+ }
232
+
233
+ resource dispenser-block-entity {
234
+ get-block-entity: func() -> block-entity;
235
+ get-container: func() -> container-block-entity;
236
+ }
237
+
238
+ resource dropper-block-entity {
239
+ get-block-entity: func() -> block-entity;
240
+ get-container: func() -> container-block-entity;
241
+ }
242
+
243
+ resource enchanting-table-block-entity {
244
+ get-block-entity: func() -> block-entity;
245
+ }
246
+
247
+ resource end-gateway-block-entity {
248
+ get-block-entity: func() -> block-entity;
249
+ get-age: func() -> s64;
250
+ is-exact-teleport: func() -> bool;
251
+ }
252
+
253
+ resource end-portal-block-entity {
254
+ get-block-entity: func() -> block-entity;
255
+ }
256
+
257
+ resource ender-chest-block-entity {
258
+ get-block-entity: func() -> block-entity;
259
+ viewer-count: func() -> u32;
260
+ }
261
+
262
+ resource furnace-block-entity {
263
+ get-block-entity: func() -> block-entity;
264
+ get-container: func() -> container-block-entity;
265
+ get-cooking-time-spent: func() -> u16;
266
+ get-cooking-total-time: func() -> u16;
267
+ get-lit-time-remaining: func() -> u16;
268
+ get-lit-total-time: func() -> u16;
269
+ is-burning: func() -> bool;
270
+ }
271
+
272
+ resource hopper-block-entity {
273
+ get-block-entity: func() -> block-entity;
274
+ get-container: func() -> container-block-entity;
275
+ get-cooldown: func() -> s32;
276
+ }
277
+
278
+ resource jigsaw-block-entity {
279
+ get-block-entity: func() -> block-entity;
280
+ get-name: func() -> string;
281
+ get-target: func() -> string;
282
+ get-pool: func() -> string;
283
+ get-final-state: func() -> string;
284
+ get-selection-priority: func() -> s32;
285
+ get-placement-priority: func() -> s32;
286
+ }
287
+
288
+ resource lectern-block-entity {
289
+ get-block-entity: func() -> block-entity;
290
+ get-container: func() -> container-block-entity;
291
+ get-page: func() -> u32;
292
+ }
293
+
294
+ resource piston-block-entity {
295
+ get-block-entity: func() -> block-entity;
296
+ get-progress: func() -> f32;
297
+ is-extending: func() -> bool;
298
+ is-source: func() -> bool;
299
+ }
300
+
301
+ resource potent-sulfur-block-entity {
302
+ get-block-entity: func() -> block-entity;
303
+ }
304
+
305
+ resource sculk-catalyst-block-entity {
306
+ get-block-entity: func() -> block-entity;
307
+ }
308
+
309
+ resource sculk-sensor-block-entity {
310
+ get-block-entity: func() -> block-entity;
311
+ }
312
+
313
+ resource sculk-shrieker-block-entity {
314
+ get-block-entity: func() -> block-entity;
315
+ get-warning-level: func() -> s32;
316
+ }
317
+
318
+ resource shelf-block-entity {
319
+ get-block-entity: func() -> block-entity;
320
+ get-container: func() -> container-block-entity;
321
+ }
322
+
323
+ resource shulker-box-block-entity {
324
+ get-block-entity: func() -> block-entity;
325
+ get-container: func() -> container-block-entity;
326
+ viewer-count: func() -> u32;
327
+ }
328
+
329
+ resource skull-block-entity {
330
+ get-block-entity: func() -> block-entity;
331
+ get-note-block-sound: func() -> option<string>;
332
+ }
333
+
334
+ resource smoker-block-entity {
335
+ get-block-entity: func() -> block-entity;
336
+ get-container: func() -> container-block-entity;
337
+ get-cooking-time-spent: func() -> u16;
338
+ get-cooking-total-time: func() -> u16;
339
+ get-lit-time-remaining: func() -> u16;
340
+ get-lit-total-time: func() -> u16;
341
+ is-burning: func() -> bool;
342
+ }
343
+
344
+ resource structure-block-block-entity {
345
+ get-block-entity: func() -> block-entity;
346
+ get-name: func() -> string;
347
+ get-author: func() -> string;
348
+ get-mode: func() -> string;
349
+ get-integrity: func() -> f32;
350
+ get-seed: func() -> s64;
351
+ }
352
+
353
+ resource test-block-block-entity {
354
+ get-block-entity: func() -> block-entity;
355
+ }
356
+
357
+ resource test-instance-block-block-entity {
358
+ get-block-entity: func() -> block-entity;
359
+ }
360
+
361
+ resource trial-spawner-block-entity {
362
+ get-block-entity: func() -> block-entity;
363
+ }
364
+
365
+ resource vault-block-entity {
366
+ get-block-entity: func() -> block-entity;
367
+ }
368
+
369
+ variant block-entity-type {
370
+ command-block-entity(command-block-entity),
371
+ sign-block-entity(sign-block-entity),
372
+ hanging-sign-block-entity(hanging-sign-block-entity),
373
+ jukebox-block-entity(jukebox-block-entity),
374
+ chest-block-entity(chest-block-entity),
375
+ trapped-chest-block-entity(trapped-chest-block-entity),
376
+ mob-spawner-block-entity(mob-spawner-block-entity),
377
+ map-block-entity(map-block-entity),
378
+ banner-block-entity(banner-block-entity),
379
+ barrel-block-entity(barrel-block-entity),
380
+ beacon-block-entity(beacon-block-entity),
381
+ bed-block-entity(bed-block-entity),
382
+ beehive-block-entity(beehive-block-entity),
383
+ bell-block-entity(bell-block-entity),
384
+ blasting-furnace-block-entity(blasting-furnace-block-entity),
385
+ brewing-stand-block-entity(brewing-stand-block-entity),
386
+ brushable-block-block-entity(brushable-block-block-entity),
387
+ calibrated-sculk-sensor-block-entity(calibrated-sculk-sensor-block-entity),
388
+ campfire-block-entity(campfire-block-entity),
389
+ chiseled-bookshelf-block-entity(chiseled-bookshelf-block-entity),
390
+ comparator-block-entity(comparator-block-entity),
391
+ conduit-block-entity(conduit-block-entity),
392
+ copper-golem-statue-block-entity(copper-golem-statue-block-entity),
393
+ crafter-block-entity(crafter-block-entity),
394
+ creaking-heart-block-entity(creaking-heart-block-entity),
395
+ daylight-detector-block-entity(daylight-detector-block-entity),
396
+ decorated-pot-block-entity(decorated-pot-block-entity),
397
+ dispenser-block-entity(dispenser-block-entity),
398
+ dropper-block-entity(dropper-block-entity),
399
+ enchanting-table-block-entity(enchanting-table-block-entity),
400
+ end-gateway-block-entity(end-gateway-block-entity),
401
+ end-portal-block-entity(end-portal-block-entity),
402
+ ender-chest-block-entity(ender-chest-block-entity),
403
+ furnace-block-entity(furnace-block-entity),
404
+ hopper-block-entity(hopper-block-entity),
405
+ jigsaw-block-entity(jigsaw-block-entity),
406
+ lectern-block-entity(lectern-block-entity),
407
+ piston-block-entity(piston-block-entity),
408
+ potent-sulfur-block-entity(potent-sulfur-block-entity),
409
+ sculk-catalyst-block-entity(sculk-catalyst-block-entity),
410
+ sculk-sensor-block-entity(sculk-sensor-block-entity),
411
+ sculk-shrieker-block-entity(sculk-shrieker-block-entity),
412
+ shelf-block-entity(shelf-block-entity),
413
+ shulker-box-block-entity(shulker-box-block-entity),
414
+ skull-block-entity(skull-block-entity),
415
+ smoker-block-entity(smoker-block-entity),
416
+ structure-block-block-entity(structure-block-block-entity),
417
+ test-block-block-entity(test-block-block-entity),
418
+ test-instance-block-block-entity(test-instance-block-block-entity),
419
+ trial-spawner-block-entity(trial-spawner-block-entity),
420
+ vault-block-entity(vault-block-entity),
421
+ container-block-entity(container-block-entity),
422
+ }
423
+ }
@@ -0,0 +1,83 @@
1
+ interface boss-bar {
2
+ use text.{text-component};
3
+ use player.{player};
4
+
5
+
6
+ /// Represents the color of a boss bar.
7
+ enum boss-bar-color {
8
+ pink,
9
+ blue,
10
+ red,
11
+ green,
12
+ yellow,
13
+ purple,
14
+ white,
15
+ }
16
+
17
+ /// Represents the notches/divisions of a boss bar.
18
+ enum boss-bar-division {
19
+ no-division,
20
+ notches-6,
21
+ notches-10,
22
+ notches-12,
23
+ notches-20,
24
+ }
25
+
26
+ /// Metadata flags that can be toggled on a boss bar.
27
+ record boss-bar-metadata {
28
+ /// Darkens the sky for players who see the boss bar.
29
+ darken-sky: bool,
30
+ /// If true, the bar is considered a "dragon bar" (used for Ender Dragon).
31
+ dragon-bar: bool,
32
+ /// If true, fog is created around the players who see the boss bar.
33
+ create-fog: bool,
34
+ }
35
+
36
+ /// Represents a boss bar that can be shown to players.
37
+ resource boss-bar {
38
+ /// Creates a new boss bar.
39
+ constructor(title: text-component, color: boss-bar-color, division: boss-bar-division);
40
+
41
+ /// Returns the title of this boss bar.
42
+ get-title: func() -> text-component;
43
+
44
+ /// Sets the title of this boss bar.
45
+ set-title: func(title: text-component);
46
+
47
+ /// Returns the health (0.0 to 1.0) of this boss bar.
48
+ get-health: func() -> f32;
49
+
50
+ /// Sets the health (0.0 to 1.0) of this boss bar.
51
+ set-health: func(health: f32);
52
+
53
+ /// Returns the color of this boss bar.
54
+ get-color: func() -> boss-bar-color;
55
+
56
+ /// Sets the color of this boss bar.
57
+ set-color: func(color: boss-bar-color);
58
+
59
+ /// Returns the division of this boss bar.
60
+ get-division: func() -> boss-bar-division;
61
+
62
+ /// Sets the division of this boss bar.
63
+ set-division: func(division: boss-bar-division);
64
+
65
+ /// Returns the currently active metadata on this boss bar.
66
+ get-metadata: func() -> boss-bar-metadata;
67
+
68
+ /// Updates the metadata on this boss bar.
69
+ set-metadata: func(metadata: boss-bar-metadata);
70
+
71
+ /// Adds a player to this boss bar, making it visible to them.
72
+ add-player: func(player: player);
73
+
74
+ /// Removes a player from this boss bar, hiding it from them.
75
+ remove-player: func(player: player);
76
+
77
+ /// Returns a list of all players currently seeing this boss bar.
78
+ get-players: func() -> list<player>;
79
+
80
+ /// Removes this boss bar from all players and cleans it up.
81
+ remove-all: func();
82
+ }
83
+ }