@minecraft/server 1.0.0-preview.1.19.50.21 → 1.0.0-preview.1.19.50.22

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 (2) hide show
  1. package/index.d.ts +38 -17
  2. package/package.json +1 -1
package/index.d.ts CHANGED
@@ -15,7 +15,7 @@
15
15
  * ```json
16
16
  * {
17
17
  * "module_name": "@minecraft/server",
18
- * "version": "1.1.0-internal.preview.1.19.50.21"
18
+ * "version": "1.1.0-internal.preview.1.19.50.22"
19
19
  * }
20
20
  * ```
21
21
  *
@@ -24,19 +24,20 @@
24
24
  * Contains return data on the result of a command execution.
25
25
  */
26
26
  export class CommandResult {
27
+ protected constructor();
27
28
  /**
28
29
  * If the command operates against a number of entities,
29
30
  * blocks, or items, this returns the number of successful
30
31
  * applications of this command.
31
32
  */
32
33
  readonly successCount: number;
33
- protected constructor();
34
34
  }
35
35
  /**
36
36
  * A class that represents a particular dimension (e.g., The
37
37
  * End) within a world.
38
38
  */
39
39
  export class Dimension {
40
+ protected constructor();
40
41
  /**
41
42
  * Identifier of the dimension.
42
43
  * @throws This property can throw when used.
@@ -45,9 +46,9 @@ export class Dimension {
45
46
  /**
46
47
  * @remarks
47
48
  * Runs a particular command asynchronously from the context of
48
- * the broader dimension. Where possible - and especially for
49
- * long-running operations - you should use runCommandAsync
50
- * over runCommand.
49
+ * the broader dimension. Note that there is a maximum queue
50
+ * of 128 asynchronous commands that can be run in a given
51
+ * tick.
51
52
  * @param commandString
52
53
  * Command to run. Note that command strings should not start
53
54
  * with slash.
@@ -57,13 +58,13 @@ export class Dimension {
57
58
  * @throws This function can throw errors.
58
59
  */
59
60
  runCommandAsync(commandString: string): Promise<CommandResult>;
60
- protected constructor();
61
61
  }
62
62
  /**
63
63
  * Represents the state of an entity (a mob, the player, or
64
64
  * other moving objects like minecarts) in the world.
65
65
  */
66
66
  export class Entity {
67
+ protected constructor();
67
68
  /**
68
69
  * Dimension that the entity is currently within.
69
70
  * @throws This property can throw when used.
@@ -86,9 +87,8 @@ export class Entity {
86
87
  /**
87
88
  * @remarks
88
89
  * Runs a particular command asynchronously from the context of
89
- * this entity. Where possible, running a command
90
- * asynchronously is recommended, especially for long running
91
- * operations.
90
+ * this entity. Note that there is a maximum queue of 128
91
+ * asynchronous commands that can be run in a given tick.
92
92
  * @param commandString
93
93
  * Command to run. Note that command strings should not start
94
94
  * with slash.
@@ -98,13 +98,13 @@ export class Entity {
98
98
  * @throws This function can throw errors.
99
99
  */
100
100
  runCommandAsync(commandString: string): Promise<CommandResult>;
101
- protected constructor();
102
101
  }
103
102
  /**
104
103
  * A collection of default Minecraft dimension types.
105
104
  */
106
105
  // tslint:disable-next-line:no-unnecessary-class
107
106
  export class MinecraftDimensionTypes {
107
+ protected constructor();
108
108
  /**
109
109
  * The Nether is a collection of biomes separate from the
110
110
  * Overworld, including Soul Sand Valleys and Crimson forests.
@@ -132,12 +132,12 @@ export class MinecraftDimensionTypes {
132
132
  * the End.
133
133
  */
134
134
  static readonly theEnd = 'minecraft:the_end';
135
- protected constructor();
136
135
  }
137
136
  /**
138
137
  * Represents a player within the world.
139
138
  */
140
139
  export class Player extends Entity {
140
+ protected constructor();
141
141
  /**
142
142
  * Dimension that the entity is currently within.
143
143
  * @throws This property can throw when used.
@@ -165,9 +165,8 @@ export class Player extends Entity {
165
165
  /**
166
166
  * @remarks
167
167
  * Runs a particular command asynchronously from the context of
168
- * this entity. Where possible, running a command
169
- * asynchronously is recommended, especially for long running
170
- * operations.
168
+ * this entity. Note that there is a maximum queue of 128
169
+ * asynchronous commands that can be run in a given tick.
171
170
  * @param commandString
172
171
  * Command to run. Note that command strings should not start
173
172
  * with slash.
@@ -177,21 +176,44 @@ export class Player extends Entity {
177
176
  * @throws This function can throw errors.
178
177
  */
179
178
  runCommandAsync(commandString: string): Promise<CommandResult>;
180
- protected constructor();
181
179
  }
182
180
  /**
183
181
  * A class that provides system-level events and functions.
184
182
  */
185
183
  export class System {
184
+ protected constructor();
185
+ /**
186
+ * Represents the current world tick of the server.
187
+ */
186
188
  readonly currentTick: number;
189
+ /**
190
+ * @remarks
191
+ * Runs a specified function at a future time. This is
192
+ * frequently used to implement delayed behaviors and game
193
+ * loops.
194
+ * @param callback
195
+ * Function callback to run when the tickDelay time criteria is
196
+ * met.
197
+ * @param tickDelay
198
+ * Number of ticks to wait before running this function. 1
199
+ * means this function will run on the next tick. A value of 20
200
+ * means that this function will run in 20 ticks (or
201
+ * approximately one second). When the value of '0' is used
202
+ * within an event handler, this funtion will run later within
203
+ * the tick frame. Using the value of '0' within a System.run
204
+ * function is not supported.
205
+ * @returns
206
+ * An opaque identifier that can be used with the `clearRun`
207
+ * function to cancel the execution of this run.
208
+ */
187
209
  run(callback: () => void, tickDelay?: number): number;
188
- protected constructor();
189
210
  }
190
211
  /**
191
212
  * A class that wraps the state of a world - a set of
192
213
  * dimensions and the environment of Minecraft.
193
214
  */
194
215
  export class World {
216
+ protected constructor();
195
217
  getAllPlayers(): Player[];
196
218
  /**
197
219
  * @param dimensionId
@@ -201,7 +223,6 @@ export class World {
201
223
  * Throws if the given dimension name is invalid
202
224
  */
203
225
  getDimension(dimensionId: string): Dimension;
204
- protected constructor();
205
226
  }
206
227
  /**
207
228
  * A class that provides system-level events and functions.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@minecraft/server",
3
- "version": "1.0.0-preview.1.19.50.21",
3
+ "version": "1.0.0-preview.1.19.50.22",
4
4
  "description": "",
5
5
  "contributors": [
6
6
  {