pumpkin-api-py 0.1.0.dev0__py3-none-any.whl → 0.1.0.dev1__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 (49) hide show
  1. pumpkin_api/__init__.py +1 -1
  2. pumpkin_api/build.py +6 -1
  3. pumpkin_api/wit/wit_world/exports/metadata.py +1 -0
  4. pumpkin_api/wit/wit_world/imports/{entity.py → block_entity.py} +2 -2
  5. pumpkin_api/wit/wit_world/imports/command.py +4 -4
  6. pumpkin_api/wit/wit_world/imports/common.py +23 -0
  7. pumpkin_api/wit/wit_world/imports/event.py +23 -11
  8. pumpkin_api/wit/wit_world/imports/player.py +5 -0
  9. pumpkin_api/wit/wit_world/imports/world.py +73 -0
  10. pumpkin_api/wit_files/block-entity.wit +36 -0
  11. pumpkin_api/wit_files/command.wit +3 -2
  12. pumpkin_api/wit_files/common.wit +22 -0
  13. pumpkin_api/wit_files/entity.wit +1 -34
  14. pumpkin_api/wit_files/event.wit +8 -0
  15. pumpkin_api/wit_files/metadata.wit +2 -0
  16. pumpkin_api/wit_files/player.wit +3 -0
  17. pumpkin_api/wit_files/plugin.wit +4 -0
  18. pumpkin_api/wit_files/world.wit +42 -1
  19. {pumpkin_api_py-0.1.0.dev0.dist-info → pumpkin_api_py-0.1.0.dev1.dist-info}/METADATA +3 -2
  20. pumpkin_api_py-0.1.0.dev1.dist-info/RECORD +51 -0
  21. pumpkin_api/wit_files/componentize_py_async_support/__init__.py +0 -529
  22. pumpkin_api/wit_files/componentize_py_async_support/futures.py +0 -93
  23. pumpkin_api/wit_files/componentize_py_async_support/streams.py +0 -189
  24. pumpkin_api/wit_files/componentize_py_runtime.pyi +0 -34
  25. pumpkin_api/wit_files/componentize_py_types.py +0 -19
  26. pumpkin_api/wit_files/poll_loop.py +0 -440
  27. pumpkin_api/wit_files/wit_world/__init__.py +0 -70
  28. pumpkin_api/wit_files/wit_world/exports/__init__.py +0 -19
  29. pumpkin_api/wit_files/wit_world/exports/metadata.py +0 -22
  30. pumpkin_api/wit_files/wit_world/imports/__init__.py +0 -0
  31. pumpkin_api/wit_files/wit_world/imports/command.py +0 -539
  32. pumpkin_api/wit_files/wit_world/imports/common.py +0 -213
  33. pumpkin_api/wit_files/wit_world/imports/context.py +0 -70
  34. pumpkin_api/wit_files/wit_world/imports/entity.py +0 -84
  35. pumpkin_api/wit_files/wit_world/imports/event.py +0 -434
  36. pumpkin_api/wit_files/wit_world/imports/gui.py +0 -61
  37. pumpkin_api/wit_files/wit_world/imports/i18n.py +0 -35
  38. pumpkin_api/wit_files/wit_world/imports/logging.py +0 -30
  39. pumpkin_api/wit_files/wit_world/imports/permission.py +0 -71
  40. pumpkin_api/wit_files/wit_world/imports/player.py +0 -350
  41. pumpkin_api/wit_files/wit_world/imports/scheduler.py +0 -44
  42. pumpkin_api/wit_files/wit_world/imports/scoreboard.py +0 -95
  43. pumpkin_api/wit_files/wit_world/imports/server.py +0 -75
  44. pumpkin_api/wit_files/wit_world/imports/text.py +0 -89
  45. pumpkin_api/wit_files/wit_world/imports/world.py +0 -215
  46. pumpkin_api_py-0.1.0.dev0.dist-info/RECORD +0 -75
  47. {pumpkin_api_py-0.1.0.dev0.dist-info → pumpkin_api_py-0.1.0.dev1.dist-info}/WHEEL +0 -0
  48. {pumpkin_api_py-0.1.0.dev0.dist-info → pumpkin_api_py-0.1.0.dev1.dist-info}/entry_points.txt +0 -0
  49. {pumpkin_api_py-0.1.0.dev0.dist-info → pumpkin_api_py-0.1.0.dev1.dist-info}/licenses/LICENSE +0 -0
pumpkin_api/__init__.py CHANGED
@@ -23,7 +23,7 @@ from typing import Dict, Callable, Any, Type, Optional, List, Union
23
23
  from .wit.wit_world.imports import (
24
24
  server, event, command, context, text, scheduler,
25
25
  logging, gui, scoreboard, i18n, player, world,
26
- common, entity, permission
26
+ common, block_entity, permission
27
27
  )
28
28
  from .wit.wit_world.exports import metadata
29
29
  from componentize_py_types import Err
pumpkin_api/build.py CHANGED
@@ -11,7 +11,12 @@ def main():
11
11
 
12
12
  import pumpkin_api
13
13
  pkg_dir = os.path.dirname(pumpkin_api.__file__)
14
- wit_dir = os.path.join(pkg_dir, "wit_files")
14
+ # Check if we are in a source checkout with the submodule
15
+ repo_wit_dir = os.path.join(os.path.dirname(os.path.dirname(pkg_dir)), "pumpkin-wit", "pumpkin-plugin-wit", "v0.1.0")
16
+ if os.path.exists(repo_wit_dir):
17
+ wit_dir = repo_wit_dir
18
+ else:
19
+ wit_dir = os.path.join(pkg_dir, "wit_files")
15
20
 
16
21
  # Pass the parent directory of pumpkin_api to componentize-py so it can resolve `pumpkin_api` module
17
22
  # in case it's not installed in a standard site-packages (e.g. editable install or no venv)
@@ -19,4 +19,5 @@ class PluginMetadata:
19
19
  version: str
20
20
  authors: List[str]
21
21
  description: str
22
+ dependencies: List[str]
22
23
 
@@ -74,11 +74,11 @@ class CommandBlockEntity:
74
74
 
75
75
 
76
76
  @dataclass
77
- class Entity_CommandBlockEntity:
77
+ class BlockEntityType_CommandBlockEntity:
78
78
  value: CommandBlockEntity
79
79
 
80
80
 
81
- Entity = Union[Entity_CommandBlockEntity]
81
+ BlockEntityType = Union[BlockEntityType_CommandBlockEntity]
82
82
 
83
83
 
84
84
 
@@ -9,7 +9,7 @@ import weakref
9
9
 
10
10
  from componentize_py_types import Result, Ok, Err, Some
11
11
  from ..imports import common
12
- from ..imports import entity
12
+ from ..imports import block_entity
13
13
  from ..imports import text
14
14
  from ..imports import world
15
15
  from ..imports import player
@@ -95,12 +95,12 @@ NotInBounds = Union[NotInBounds_LowerBound, NotInBounds_UpperBound]
95
95
 
96
96
  @dataclass
97
97
  class Arg_Entities:
98
- value: List[entity.Entity]
98
+ value: List[world.Entity]
99
99
 
100
100
 
101
101
  @dataclass
102
102
  class Arg_Entity:
103
- value: entity.Entity
103
+ value: world.Entity
104
104
 
105
105
 
106
106
  @dataclass
@@ -269,7 +269,7 @@ class CommandSenderType_Player:
269
269
 
270
270
  @dataclass
271
271
  class CommandSenderType_CommandBlock:
272
- value: Tuple[entity.CommandBlockEntity, world.World]
272
+ value: Tuple[block_entity.CommandBlockEntity, world.World]
273
273
 
274
274
 
275
275
  @dataclass
@@ -77,6 +77,29 @@ class ItemStack:
77
77
  registry_key: str
78
78
  count: int
79
79
 
80
+ class EntityPose(Enum):
81
+ """
82
+ Represents the various poses an entity can be in.
83
+ """
84
+ STANDING = 0
85
+ FALL_FLYING = 1
86
+ SLEEPING = 2
87
+ SWIMMING = 3
88
+ SPIN_ATTACK = 4
89
+ CROUCHING = 5
90
+ LONG_JUMPING = 6
91
+ DYING = 7
92
+ CROAKING = 8
93
+ USING_TONGUE = 9
94
+ SITTING = 10
95
+ ROARING = 11
96
+ SNIFFING = 12
97
+ EMERGING = 13
98
+ DIGGING = 14
99
+ SLIDING = 15
100
+ SHOOTING = 16
101
+ INHALING = 17
102
+
80
103
  class Locale(Enum):
81
104
  """
82
105
  All Minecraft-supported locales.
@@ -166,6 +166,12 @@ class PlayerToggleSneakEventData:
166
166
  is_sneaking: bool
167
167
  cancelled: bool
168
168
 
169
+ @dataclass
170
+ class PlayerToggleFlightEventData:
171
+ player: player.Player
172
+ is_flying: bool
173
+ cancelled: bool
174
+
169
175
  @dataclass
170
176
  class PlayerToggleSprintEventData:
171
177
  player: player.Player
@@ -271,16 +277,17 @@ class EventType(Enum):
271
277
  PLAYER_INTERACT_UNKNOWN_ENTITY_EVENT = 16
272
278
  PLAYER_INTERACT_EVENT = 17
273
279
  PLAYER_TOGGLE_SNEAK_EVENT = 18
274
- PLAYER_TOGGLE_SPRINT_EVENT = 19
275
- BLOCK_REDSTONE_EVENT = 20
276
- BLOCK_BREAK_EVENT = 21
277
- BLOCK_BURN_EVENT = 22
278
- BLOCK_CAN_BUILD_EVENT = 23
279
- BLOCK_GROW_EVENT = 24
280
- BLOCK_PLACE_EVENT = 25
281
- SERVER_COMMAND_EVENT = 26
282
- SPAWN_CHANGE_EVENT = 27
283
- SERVER_BROADCAST_EVENT = 28
280
+ PLAYER_TOGGLE_FLIGHT_EVENT = 19
281
+ PLAYER_TOGGLE_SPRINT_EVENT = 20
282
+ BLOCK_REDSTONE_EVENT = 21
283
+ BLOCK_BREAK_EVENT = 22
284
+ BLOCK_BURN_EVENT = 23
285
+ BLOCK_CAN_BUILD_EVENT = 24
286
+ BLOCK_GROW_EVENT = 25
287
+ BLOCK_PLACE_EVENT = 26
288
+ SERVER_COMMAND_EVENT = 27
289
+ SPAWN_CHANGE_EVENT = 28
290
+ SERVER_BROADCAST_EVENT = 29
284
291
 
285
292
 
286
293
  @dataclass
@@ -378,6 +385,11 @@ class Event_PlayerToggleSneakEvent:
378
385
  value: PlayerToggleSneakEventData
379
386
 
380
387
 
388
+ @dataclass
389
+ class Event_PlayerToggleFlightEvent:
390
+ value: PlayerToggleFlightEventData
391
+
392
+
381
393
  @dataclass
382
394
  class Event_PlayerToggleSprintEvent:
383
395
  value: PlayerToggleSprintEventData
@@ -428,7 +440,7 @@ class Event_ServerBroadcastEvent:
428
440
  value: ServerBroadcastEventData
429
441
 
430
442
 
431
- Event = Union[Event_PlayerJoinEvent, Event_PlayerLeaveEvent, Event_PlayerLoginEvent, Event_PlayerChatEvent, Event_PlayerCommandSendEvent, Event_PlayerPermissionCheckEvent, Event_PlayerMoveEvent, Event_PlayerTeleportEvent, Event_PlayerChangeWorldEvent, Event_PlayerExpChangeEvent, Event_PlayerItemHeldEvent, Event_PlayerChangedMainHandEvent, Event_PlayerGamemodeChangeEvent, Event_PlayerCustomPayloadEvent, Event_PlayerFishEvent, Event_PlayerEggThrowEvent, Event_PlayerInteractUnknownEntityEvent, Event_PlayerInteractEvent, Event_PlayerToggleSneakEvent, Event_PlayerToggleSprintEvent, Event_BlockRedstoneEvent, Event_BlockBreakEvent, Event_BlockBurnEvent, Event_BlockCanBuildEvent, Event_BlockGrowEvent, Event_BlockPlaceEvent, Event_ServerCommandEvent, Event_SpawnChangeEvent, Event_ServerBroadcastEvent]
443
+ Event = Union[Event_PlayerJoinEvent, Event_PlayerLeaveEvent, Event_PlayerLoginEvent, Event_PlayerChatEvent, Event_PlayerCommandSendEvent, Event_PlayerPermissionCheckEvent, Event_PlayerMoveEvent, Event_PlayerTeleportEvent, Event_PlayerChangeWorldEvent, Event_PlayerExpChangeEvent, Event_PlayerItemHeldEvent, Event_PlayerChangedMainHandEvent, Event_PlayerGamemodeChangeEvent, Event_PlayerCustomPayloadEvent, Event_PlayerFishEvent, Event_PlayerEggThrowEvent, Event_PlayerInteractUnknownEntityEvent, Event_PlayerInteractEvent, Event_PlayerToggleSneakEvent, Event_PlayerToggleFlightEvent, Event_PlayerToggleSprintEvent, Event_BlockRedstoneEvent, Event_BlockBreakEvent, Event_BlockBurnEvent, Event_BlockCanBuildEvent, Event_BlockGrowEvent, Event_BlockPlaceEvent, Event_ServerCommandEvent, Event_SpawnChangeEvent, Event_ServerBroadcastEvent]
432
444
 
433
445
 
434
446
 
@@ -35,6 +35,11 @@ class Player:
35
35
  A handle to a player on the server.
36
36
  """
37
37
 
38
+ def as_entity(self) -> world.Entity:
39
+ """
40
+ Returns the player as an entity.
41
+ """
42
+ raise NotImplementedError
38
43
  def get_id(self) -> str:
39
44
  """
40
45
  Returns the player's unique UUID as a string.
@@ -8,6 +8,7 @@ from abc import abstractmethod
8
8
  import weakref
9
9
 
10
10
  from componentize_py_types import Result, Ok, Err, Some
11
+ from ..imports import common
11
12
  from ..imports import text
12
13
  from ..imports import scoreboard
13
14
 
@@ -201,6 +202,78 @@ class World:
201
202
  Returns the minimum Y coordinate (bottom of the world).
202
203
  """
203
204
  raise NotImplementedError
205
+ def get_entities(self) -> List[Any]:
206
+ """
207
+ Returns a list of all entities in this world.
208
+ """
209
+ raise NotImplementedError
210
+ def __enter__(self) -> Self:
211
+ """Returns self"""
212
+ return self
213
+
214
+ def __exit__(self, exc_type: type[BaseException] | None, exc_value: BaseException | None, traceback: TracebackType | None) -> bool | None:
215
+ """
216
+ Release this resource.
217
+ """
218
+ raise NotImplementedError
219
+
220
+
221
+ class Entity:
222
+
223
+ def get_id(self) -> int:
224
+ raise NotImplementedError
225
+ def get_uuid(self) -> str:
226
+ raise NotImplementedError
227
+ def get_type(self) -> str:
228
+ raise NotImplementedError
229
+ def get_position(self) -> Tuple[float, float, float]:
230
+ raise NotImplementedError
231
+ def get_world(self) -> World:
232
+ raise NotImplementedError
233
+ def get_yaw(self) -> float:
234
+ raise NotImplementedError
235
+ def get_pitch(self) -> float:
236
+ raise NotImplementedError
237
+ def get_head_yaw(self) -> float:
238
+ raise NotImplementedError
239
+ def is_on_ground(self) -> bool:
240
+ raise NotImplementedError
241
+ def is_sneaking(self) -> bool:
242
+ raise NotImplementedError
243
+ def is_sprinting(self) -> bool:
244
+ raise NotImplementedError
245
+ def is_invisible(self) -> bool:
246
+ raise NotImplementedError
247
+ def is_glowing(self) -> bool:
248
+ raise NotImplementedError
249
+ def teleport(self, pos: Tuple[float, float, float], world_ref: World) -> None:
250
+ raise NotImplementedError
251
+ def set_velocity(self, velocity: Tuple[float, float, float]) -> None:
252
+ raise NotImplementedError
253
+ def get_velocity(self) -> Tuple[float, float, float]:
254
+ raise NotImplementedError
255
+ def get_pose(self) -> common.EntityPose:
256
+ raise NotImplementedError
257
+ def get_name(self) -> text.TextComponent:
258
+ raise NotImplementedError
259
+ def set_custom_name(self, name: text.TextComponent) -> None:
260
+ raise NotImplementedError
261
+ def get_custom_name(self) -> Optional[text.TextComponent]:
262
+ raise NotImplementedError
263
+ def set_custom_name_visible(self, visible: bool) -> None:
264
+ raise NotImplementedError
265
+ def is_custom_name_visible(self) -> bool:
266
+ raise NotImplementedError
267
+ def is_invulnerable(self) -> bool:
268
+ raise NotImplementedError
269
+ def set_invulnerable(self, invulnerable: bool) -> None:
270
+ raise NotImplementedError
271
+ def get_fire_ticks(self) -> int:
272
+ raise NotImplementedError
273
+ def set_fire_ticks(self, ticks: int) -> None:
274
+ raise NotImplementedError
275
+ def remove(self) -> None:
276
+ raise NotImplementedError
204
277
  def __enter__(self) -> Self:
205
278
  """Returns self"""
206
279
  return self
@@ -0,0 +1,36 @@
1
+ interface block-entity {
2
+ use common.{block-position};
3
+
4
+ resource block-entity {
5
+ resource-location: func() -> string;
6
+ get-position: func() -> block-position;
7
+ get-id: func() -> u32;
8
+ // write-nbt: func(nbt: nbt-compound);
9
+ // from-nbt: func(nbt: nbt-compound, position: block-position) -> entity;
10
+ // tick: func(world: simple-world);
11
+ // write-internal: func(nbt: nbt-compound);
12
+ // chunk-data-nbt: func() -> option<nbt-compound;
13
+ // get-inventory: func() -> option<inventory>;
14
+ // set-block-state: func(block-state: block-state-id);
15
+ // on-block-replaced: func(world: simple-world, position: block-position);
16
+ is-dirty: func() -> bool;
17
+ clear-dirty: func();
18
+ // to-property-delegate: func() -> option<property-delegate>;
19
+ // to-experience-container: func() -> option<experience-container>;
20
+ }
21
+
22
+ resource command-block-entity {
23
+ get-block-entity: func () -> block-entity;
24
+ last-output: func() -> string;
25
+ track-output: func() -> bool;
26
+ success-count: func() -> u32;
27
+ command: func() -> string;
28
+ auto: func() -> bool;
29
+ condition-met: func() -> bool;
30
+ powered: func() -> bool;
31
+ }
32
+
33
+ variant block-entity-type {
34
+ command-block-entity(command-block-entity),
35
+ }
36
+ }
@@ -1,7 +1,8 @@
1
1
  interface command {
2
- use player.{player};
3
2
  use %world.{%world};
4
- use entity.{command-block-entity, entity};
3
+ use entity.{entity};
4
+ use player.{player};
5
+ use block-entity.{command-block-entity};
5
6
  use common.{position, block-position, locale};
6
7
  use server.{server, difficulty};
7
8
  use text.{text-component};
@@ -67,6 +67,28 @@ interface common {
67
67
  count: u8,
68
68
  }
69
69
 
70
+ /// Represents the various poses an entity can be in.
71
+ enum entity-pose {
72
+ standing,
73
+ fall-flying,
74
+ sleeping,
75
+ swimming,
76
+ spin-attack,
77
+ crouching,
78
+ long-jumping,
79
+ dying,
80
+ croaking,
81
+ using-tongue,
82
+ sitting,
83
+ roaring,
84
+ sniffing,
85
+ emerging,
86
+ digging,
87
+ sliding,
88
+ shooting,
89
+ inhaling,
90
+ }
91
+
70
92
  /// All Minecraft-supported locales.
71
93
  enum locale {
72
94
  af-za,
@@ -1,36 +1,3 @@
1
1
  interface entity {
2
- use common.{block-position};
3
-
4
- resource block-entity {
5
- resource-location: func() -> string;
6
- get-position: func() -> block-position;
7
- get-id: func() -> u32;
8
- // write-nbt: func(nbt: nbt-compound);
9
- // from-nbt: func(nbt: nbt-compound, position: block-position) -> entity;
10
- // tick: func(world: simple-world);
11
- // write-internal: func(nbt: nbt-compound);
12
- // chunk-data-nbt: func() -> option<nbt-compound;
13
- // get-inventory: func() -> option<inventory>;
14
- // set-block-state: func(block-state: block-state-id);
15
- // on-block-replaced: func(world: simple-world, position: block-position);
16
- is-dirty: func() -> bool;
17
- clear-dirty: func();
18
- // to-property-delegate: func() -> option<property-delegate>;
19
- // to-experience-container: func() -> option<experience-container>;
20
- }
21
-
22
- resource command-block-entity {
23
- get-block-entity: func () -> block-entity;
24
- last-output: func() -> string;
25
- track-output: func() -> bool;
26
- success-count: func() -> u32;
27
- command: func() -> string;
28
- auto: func() -> bool;
29
- condition-met: func() -> bool;
30
- powered: func() -> bool;
31
- }
32
-
33
- variant entity {
34
- command-block-entity(command-block-entity),
35
- }
2
+ use %world.{entity};
36
3
  }
@@ -161,6 +161,12 @@ interface event {
161
161
  cancelled: bool
162
162
  }
163
163
 
164
+ record player-toggle-flight-event-data {
165
+ player: player,
166
+ is-flying: bool,
167
+ cancelled: bool
168
+ }
169
+
164
170
  record player-toggle-sprint-event-data {
165
171
  player: player,
166
172
  is-sprinting: bool,
@@ -265,6 +271,7 @@ interface event {
265
271
  player-interact-unknown-entity-event,
266
272
  player-interact-event,
267
273
  player-toggle-sneak-event,
274
+ player-toggle-flight-event,
268
275
  player-toggle-sprint-event,
269
276
  block-redstone-event,
270
277
  block-break-event,
@@ -297,6 +304,7 @@ interface event {
297
304
  player-interact-unknown-entity-event(player-interact-unknown-entity-event-data),
298
305
  player-interact-event(player-interact-event-data),
299
306
  player-toggle-sneak-event(player-toggle-sneak-event-data),
307
+ player-toggle-flight-event(player-toggle-flight-event-data),
300
308
  player-toggle-sprint-event(player-toggle-sprint-event-data),
301
309
  block-redstone-event(block-redstone-event-data),
302
310
  block-break-event(block-break-event-data),
@@ -9,6 +9,8 @@ interface metadata {
9
9
  authors: list<string>,
10
10
  /// Short description of the plugin.
11
11
  description: string,
12
+ /// Plugin dependencies.
13
+ dependencies: list<string>,
12
14
  }
13
15
 
14
16
  get-metadata: func() -> plugin-metadata;
@@ -2,6 +2,7 @@
2
2
  interface player {
3
3
  use common.{hand, item-stack, position, game-mode};
4
4
  use %world.{%world};
5
+ use entity.{entity};
5
6
  use permission.{permission-level};
6
7
  use text.{text-component};
7
8
  use gui.{gui};
@@ -26,6 +27,8 @@ interface player {
26
27
 
27
28
  /// A handle to a player on the server.
28
29
  resource player {
30
+ /// Returns the player as an entity.
31
+ as-entity: func () -> entity;
29
32
  /// Returns the player's unique UUID as a string.
30
33
  get-id: func () -> string;
31
34
  /// Returns the player's username.
@@ -29,6 +29,10 @@ world plugin {
29
29
  import i18n;
30
30
  /// Provides task scheduling for delayed or repeating logic.
31
31
  import scheduler;
32
+ /// Provides world information and block manipulation.
33
+ import %world;
34
+ /// Provides entity types and manipulation.
35
+ import entity;
32
36
 
33
37
  // --- Plugin-provided exports ---
34
38
 
@@ -1,5 +1,5 @@
1
1
  interface %world {
2
- use common.{position};
2
+ use common.{position, entity-pose};
3
3
  use text.{text-component};
4
4
  use scoreboard.{scoreboard};
5
5
 
@@ -101,6 +101,44 @@ interface %world {
101
101
  z: s32,
102
102
  }
103
103
 
104
+ resource entity {
105
+ get-id: func() -> u32;
106
+ get-uuid: func() -> string;
107
+ get-type: func() -> string;
108
+
109
+ get-position: func() -> position;
110
+ get-world: func() -> %world;
111
+
112
+ get-yaw: func() -> f32;
113
+ get-pitch: func() -> f32;
114
+ get-head-yaw: func() -> f32;
115
+
116
+ is-on-ground: func() -> bool;
117
+ is-sneaking: func() -> bool;
118
+ is-sprinting: func() -> bool;
119
+ is-invisible: func() -> bool;
120
+ is-glowing: func() -> bool;
121
+
122
+ teleport: func(pos: position, world-ref: %world);
123
+ set-velocity: func(velocity: position);
124
+ get-velocity: func() -> position;
125
+
126
+ get-pose: func() -> entity-pose;
127
+ get-name: func() -> text-component;
128
+ set-custom-name: func(name: text-component);
129
+ get-custom-name: func() -> option<text-component>;
130
+ set-custom-name-visible: func(visible: bool);
131
+ is-custom-name-visible: func() -> bool;
132
+
133
+ is-invulnerable: func() -> bool;
134
+ set-invulnerable: func(invulnerable: bool);
135
+
136
+ get-fire-ticks: func() -> s32;
137
+ set-fire-ticks: func(ticks: s32);
138
+
139
+ remove: func();
140
+ }
141
+
104
142
  /// Represents a Minecraft world (dimension).
105
143
  resource %world {
106
144
  /// Returns the unique identifier of this world.
@@ -165,5 +203,8 @@ interface %world {
165
203
 
166
204
  /// Returns the minimum Y coordinate (bottom of the world).
167
205
  get-min-y: func() -> s32;
206
+
207
+ /// Returns a list of all entities in this world.
208
+ get-entities: func() -> list<entity>;
168
209
  }
169
210
  }
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pumpkin-api-py
3
- Version: 0.1.0.dev0
3
+ Version: 0.1.0.dev1
4
4
  Summary: Pumpkin plugin API for Python
5
5
  Author: alex
6
6
  License-Expression: GPL-3.0-only
@@ -35,7 +35,8 @@ class MyPlugin(Plugin):
35
35
  name="my-plugin",
36
36
  version="0.1.0",
37
37
  authors=["you"],
38
- description="An example plugin."
38
+ description="An example plugin.",
39
+ dependencies=[]
39
40
  )
40
41
 
41
42
  def on_load(self, ctx: context.Context) -> None:
@@ -0,0 +1,51 @@
1
+ pumpkin_api/wit_files/block-entity.wit,sha256=UtPgcxtaOL50-mV3rskGYlSVoy0Q9SvqO02lGHXzF0U,1349
2
+ pumpkin_api/wit_files/command.wit,sha256=KmWN6VSxNUz21CAruQfUtpc0HHOIe6ESvDdR5p_mTBs,4659
3
+ pumpkin_api/wit_files/common.wit,sha256=HB1OSpeThyQuMbewJRXR14axUt09Vi1-CdN0O2Kry7Y,4007
4
+ pumpkin_api/wit_files/context.wit,sha256=-cFh8YUsXzfSDq26nIesYm4mjzPbtSh5jrpn_djScv8,1388
5
+ pumpkin_api/wit_files/entity.wit,sha256=OwmIfY-_6VkwD5beRAo_OMa7ig_XbS0a72qpblC91P4,46
6
+ pumpkin_api/wit_files/event.wit,sha256=88xT5Bc0mOsr6Vu50Q5zvM8ocLH2xvPZ-nuHmiJ5urQ,8423
7
+ pumpkin_api/wit_files/gui.wit,sha256=gushhk_4KDfNj1iMkGBV4Y8tgJXbX217ZATk5wXV6T8,791
8
+ pumpkin_api/wit_files/i18n.wit,sha256=eAeFkI2N-5MG4cc_-g0-mpOsX1BzF6clAZ603PvWweg,758
9
+ pumpkin_api/wit_files/log.wit,sha256=h7j6AO9uUKcWVC70j6GLC3vQXuy-CcICRqfIDmtXg0o,309
10
+ pumpkin_api/wit_files/metadata.wit,sha256=nezu18ck20EnJ-m199-9u7Xh5ohleU_q6WD0J6M4Go8,487
11
+ pumpkin_api/wit_files/permission.wit,sha256=3LLdPwL0TcKvfp28ZFthdFOtXWKJgf0d1aEO95UM0b4,1653
12
+ pumpkin_api/wit_files/player.wit,sha256=lDMFKSt67_FsaxiIolOfQtxCbGi6SriUie6KSIc8Zrs,7556
13
+ pumpkin_api/wit_files/plugin.wit,sha256=ekEOvXkdPE_uIIdtgbj9LeF_Je67i_8wGRgsoY40Hcs,2441
14
+ pumpkin_api/wit_files/scheduler.wit,sha256=lBpuJQwnreK1JcfXtuD6WZzYJ62M1fpa0M4UZ7KFkPo,1176
15
+ pumpkin_api/wit_files/scoreboard.wit,sha256=pR7tcQeL3i9aWB7vFKYkHM4uQIyqIIGsRkGA22oJF-M,2009
16
+ pumpkin_api/wit_files/server.wit,sha256=NGxi4v-MfIEXtLg8vDe7mwNF_x8CylJ47qmyuUJ0-RY,1371
17
+ pumpkin_api/wit_files/text.wit,sha256=IjdNsXxTzxTEOsSuDMmfF0hFsA4kuKkANW7HvMypUU8,1375
18
+ pumpkin_api/wit_files/world.wit,sha256=3lmQ9PL4tAQMweCRan-cRLtWKBTZX51F_mGKqDz-GSo,7031
19
+ pumpkin_api/__init__.py,sha256=8dm7qL5TlWao5VBlpg1OzJqKQH8G0VqN3FO0-rTNGNg,5978
20
+ pumpkin_api/app.py,sha256=P1NMxEP38xqFwjexUilEE2XdLdLnAEMWubcMZZ9lCvE,196
21
+ pumpkin_api/build.py,sha256=_qtpmBXNqI9HnRCUTUhUIwQKsHFTR5wIdzJENANfH9E,1372
22
+ pumpkin_api/wit/componentize_py_runtime.pyi,sha256=3suTYQdRo3dzsP7919mJBuxuwNbUbjnQPiMcaXZs3ic,1109
23
+ pumpkin_api/wit/componentize_py_types.py,sha256=SWM0sddLchor0Un7py0s4j-2kZQylrdpWzxmLPDHBJQ,327
24
+ pumpkin_api/wit/poll_loop.py,sha256=KUBgZTycS3Ek-a-GPQebovucd2BumNe0c2XFwupKGHI,12181
25
+ pumpkin_api/wit/componentize_py_async_support/__init__.py,sha256=6oNtCh-j2CUbmKFePX_Z86syh3j0GolOgZKPp_-UVKA,17458
26
+ pumpkin_api/wit/componentize_py_async_support/futures.py,sha256=IxvS9w0VDoZmW-FJvLvn21N7JuaX7zKu0szWlJMw_S8,3388
27
+ pumpkin_api/wit/componentize_py_async_support/streams.py,sha256=2wu0y1V8gKXTTpH8f-ssOE-WMoJO44h600-osDGKGuc,6317
28
+ pumpkin_api/wit/wit_world/__init__.py,sha256=4RW1xv4VH-SlLre6CbsKDiTkVC-GpXZIbjXEbXCgS-Q,2294
29
+ pumpkin_api/wit/wit_world/exports/__init__.py,sha256=9ggL2rLOdD7paKC08JdDnPoSn277q-m16Hnyani8ZQk,569
30
+ pumpkin_api/wit/wit_world/exports/metadata.py,sha256=j3P-hn_MXsQmCxvbOKMqzB8HGQExZKViYJJyGJTiVq0,607
31
+ pumpkin_api/wit/wit_world/imports/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
32
+ pumpkin_api/wit/wit_world/imports/block_entity.py,sha256=GwmYkITX3BDfHef9Xj6TBmuyG7AuWlVrauucSUjvPdI,2692
33
+ pumpkin_api/wit/wit_world/imports/command.py,sha256=AMIIx2iGkKSfcfX-SpNrSJEnl4CUjBJRJ_5zn82iDQE,10512
34
+ pumpkin_api/wit/wit_world/imports/common.py,sha256=S19orYR0yE8MGLxHYHXHPSqqsn1yHxuvL7JWSGwgLPI,3922
35
+ pumpkin_api/wit/wit_world/imports/context.py,sha256=zxp4bKS8bFI0wFrJgBn8DFO8CoIGG0L4b7JcHYdZJSM,2452
36
+ pumpkin_api/wit/wit_world/imports/event.py,sha256=X1cqBxjjPfWNtqdO9GKsLtciL1_l7jFBWcuNESvF-TI,9744
37
+ pumpkin_api/wit/wit_world/imports/gui.py,sha256=AUi8hnyhvi-XV9jJ2KYXHm60mWTZBjPorIXOTsNt244,1630
38
+ pumpkin_api/wit/wit_world/imports/i18n.py,sha256=gBG038CJr91bGuc7BSqR8xDmS15YT2sh6B3fWOnCIZk,1179
39
+ pumpkin_api/wit/wit_world/imports/logging.py,sha256=vVWjK9fDjj7tGKHwfsSWDTtyDFmyr4mSw5VhLSLwLS8,762
40
+ pumpkin_api/wit/wit_world/imports/permission.py,sha256=gijthLLFfZs0GVBVCsZwhnX3tMAQa8dozE934sqQ8xY,1770
41
+ pumpkin_api/wit/wit_world/imports/player.py,sha256=38br7WcpFLdm6ajJfx1C-GJ0rDh2AIsmcZG5Th7TYrc,11310
42
+ pumpkin_api/wit/wit_world/imports/scheduler.py,sha256=sI7Axa6jSCvPg9DbeKjbRPSRQPMMUUXMN636gVjwACY,1625
43
+ pumpkin_api/wit/wit_world/imports/scoreboard.py,sha256=zixPPHtgRjJHUWtEBBncvVJnrg4DwlmdJnHZSwNSO1U,3030
44
+ pumpkin_api/wit/wit_world/imports/server.py,sha256=PI8y3QX0gaQV7IS8TlO9Q6_HYi6X9k0lDIzQme6mnWk,2280
45
+ pumpkin_api/wit/wit_world/imports/text.py,sha256=QJej3ya2GDsQF2_5xbCcKe6sKsxSGC2TNzEAAjPFVA0,3031
46
+ pumpkin_api/wit/wit_world/imports/world.py,sha256=m9KR7SwY9EOCnULJk4qYAgSvYLzg3LxyU35FN-aXXCE,8878
47
+ pumpkin_api_py-0.1.0.dev1.dist-info/METADATA,sha256=_zhgswQmfqJSxfHgxZlfHX5INgY42-wmKK_FcjSrBq4,1488
48
+ pumpkin_api_py-0.1.0.dev1.dist-info/WHEEL,sha256=QccIxa26bgl1E6uMy58deGWi-0aeIkkangHcxk2kWfw,87
49
+ pumpkin_api_py-0.1.0.dev1.dist-info/entry_points.txt,sha256=2gMHCntyTe9ev4VmwHLggE-UXhZj2U7BIT5DBoYd2sU,61
50
+ pumpkin_api_py-0.1.0.dev1.dist-info/licenses/LICENSE,sha256=1Oq26e5aRaugKmSso0nYTJB_TsOoAWtYhTgje1HgFqw,35122
51
+ pumpkin_api_py-0.1.0.dev1.dist-info/RECORD,,