@minecraft/server 1.1.0-rc.1.20.0-preview.22 → 1.1.0
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.
- package/README.md +0 -2
- package/index.d.ts +46 -37
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -2,8 +2,6 @@
|
|
|
2
2
|
|
|
3
3
|
Contains many types related to manipulating a Minecraft world, including entities, blocks, dimensions, and more.
|
|
4
4
|
|
|
5
|
-
## **NOTE: This version of this module is still in pre-release. It may change or it may be removed in future releases.**
|
|
6
|
-
|
|
7
5
|
See full documentation for this module here:
|
|
8
6
|
|
|
9
7
|
https://learn.microsoft.com/en-us/minecraft/creator/scriptapi/@minecraft/server/@minecraft/server
|
package/index.d.ts
CHANGED
|
@@ -7,7 +7,6 @@
|
|
|
7
7
|
Copyright (c) Microsoft Corporation.
|
|
8
8
|
***************************************************************************** */
|
|
9
9
|
/**
|
|
10
|
-
* @beta
|
|
11
10
|
* @packageDocumentation
|
|
12
11
|
* Contains many types related to manipulating a Minecraft
|
|
13
12
|
* world, including entities, blocks, dimensions, and more.
|
|
@@ -16,18 +15,16 @@
|
|
|
16
15
|
* ```json
|
|
17
16
|
* {
|
|
18
17
|
* "module_name": "@minecraft/server",
|
|
19
|
-
* "version": "1.
|
|
18
|
+
* "version": "1.1.0"
|
|
20
19
|
* }
|
|
21
20
|
* ```
|
|
22
21
|
*
|
|
23
22
|
*/
|
|
24
23
|
/**
|
|
25
|
-
* @beta
|
|
26
24
|
* Represents a game mode for the current world experience.
|
|
27
25
|
*/
|
|
28
26
|
export enum GameMode {
|
|
29
27
|
/**
|
|
30
|
-
* @beta
|
|
31
28
|
* @remarks
|
|
32
29
|
* World is in a more locked-down experience, where blocks may
|
|
33
30
|
* not be manipulated.
|
|
@@ -35,7 +32,6 @@ export enum GameMode {
|
|
|
35
32
|
*/
|
|
36
33
|
adventure = 'adventure',
|
|
37
34
|
/**
|
|
38
|
-
* @beta
|
|
39
35
|
* @remarks
|
|
40
36
|
* World is in a full creative mode. In creative mode, the
|
|
41
37
|
* player has all the resources available in the item selection
|
|
@@ -49,7 +45,6 @@ export enum GameMode {
|
|
|
49
45
|
creative = 'creative',
|
|
50
46
|
spectator = 'spectator',
|
|
51
47
|
/**
|
|
52
|
-
* @beta
|
|
53
48
|
* @remarks
|
|
54
49
|
* World is in a survival mode, where players can take damage
|
|
55
50
|
* and entities may not be peaceful. Survival mode is where the
|
|
@@ -62,7 +57,6 @@ export enum GameMode {
|
|
|
62
57
|
}
|
|
63
58
|
|
|
64
59
|
/**
|
|
65
|
-
* @beta
|
|
66
60
|
* Represents a block in a dimension. A block represents a
|
|
67
61
|
* unique X, Y, and Z within a dimension and get/sets the state
|
|
68
62
|
* of the block at that location. This type was significantly
|
|
@@ -125,7 +119,6 @@ export class Block {
|
|
|
125
119
|
}
|
|
126
120
|
|
|
127
121
|
/**
|
|
128
|
-
* @beta
|
|
129
122
|
* Contains the combination of type {@link BlockType} and
|
|
130
123
|
* properties (also sometimes called block state) which
|
|
131
124
|
* describe a block (but does not belong to a specific {@link
|
|
@@ -139,21 +132,27 @@ export class BlockPermutation {
|
|
|
139
132
|
* this permutation. If states is not specified, matches checks
|
|
140
133
|
* against the set of types more broadly.
|
|
141
134
|
*
|
|
135
|
+
* This function can't be called in read-only mode.
|
|
136
|
+
*
|
|
142
137
|
* @param blockName
|
|
143
138
|
* An optional set of states to compare against.
|
|
144
139
|
*/
|
|
145
|
-
matches(blockName: string,
|
|
140
|
+
matches(blockName: string, properties?: Record<string, boolean | number | string>): boolean;
|
|
146
141
|
/**
|
|
147
142
|
* @remarks
|
|
148
143
|
* Given a type identifier and an optional set of properties,
|
|
149
144
|
* will return a BlockPermutation object that is usable in
|
|
150
145
|
* other block APIs (e.g., block.setPermutation)
|
|
151
146
|
*
|
|
147
|
+
* This function can't be called in read-only mode.
|
|
148
|
+
*
|
|
152
149
|
* @param blockName
|
|
153
150
|
* Identifier of the block to check.
|
|
151
|
+
* @param properties
|
|
152
|
+
* Optional additional set of properties to check against.
|
|
154
153
|
* @throws This function can throw errors.
|
|
155
154
|
*/
|
|
156
|
-
static resolve(blockName: string,
|
|
155
|
+
static resolve(blockName: string, properties?: Record<string, boolean | number | string>): BlockPermutation;
|
|
157
156
|
}
|
|
158
157
|
|
|
159
158
|
/**
|
|
@@ -185,24 +184,26 @@ export class Dimension {
|
|
|
185
184
|
*/
|
|
186
185
|
readonly id: string;
|
|
187
186
|
/**
|
|
188
|
-
* @beta
|
|
189
187
|
* @remarks
|
|
190
188
|
* Returns a block instance at the given location. This method
|
|
191
189
|
* was introduced as of version 1.17.10.21.
|
|
192
190
|
*
|
|
191
|
+
* This function can't be called in read-only mode.
|
|
192
|
+
*
|
|
193
193
|
* @param location
|
|
194
194
|
* The location at which to return a block.
|
|
195
195
|
* @returns
|
|
196
196
|
* Block at the specified location.
|
|
197
197
|
* @throws This function can throw errors.
|
|
198
198
|
*/
|
|
199
|
-
getBlock(location: Vector3): Block
|
|
199
|
+
getBlock(location: Vector3): Block;
|
|
200
200
|
/**
|
|
201
|
-
* @beta
|
|
202
201
|
* @remarks
|
|
203
202
|
* Returns a set of entities based on a set of conditions
|
|
204
203
|
* defined via the EntityQueryOptions set of filter criteria.
|
|
205
204
|
*
|
|
205
|
+
* This function can't be called in read-only mode.
|
|
206
|
+
*
|
|
206
207
|
* @param options
|
|
207
208
|
* Additional options that can be used to filter the set of
|
|
208
209
|
* entities returned.
|
|
@@ -231,10 +232,11 @@ export class Dimension {
|
|
|
231
232
|
*/
|
|
232
233
|
getEntities(options?: EntityQueryOptions): Entity[];
|
|
233
234
|
/**
|
|
234
|
-
* @beta
|
|
235
235
|
* @remarks
|
|
236
236
|
* Returns a set of entities at a particular location.
|
|
237
237
|
*
|
|
238
|
+
* This function can't be called in read-only mode.
|
|
239
|
+
*
|
|
238
240
|
* @param location
|
|
239
241
|
* The location at which to return entities.
|
|
240
242
|
* @returns
|
|
@@ -242,11 +244,12 @@ export class Dimension {
|
|
|
242
244
|
*/
|
|
243
245
|
getEntitiesAtBlockLocation(location: Vector3): Entity[];
|
|
244
246
|
/**
|
|
245
|
-
* @beta
|
|
246
247
|
* @remarks
|
|
247
248
|
* Returns a set of players based on a set of conditions
|
|
248
249
|
* defined via the EntityQueryOptions set of filter criteria.
|
|
249
250
|
*
|
|
251
|
+
* This function can't be called in read-only mode.
|
|
252
|
+
*
|
|
250
253
|
* @param options
|
|
251
254
|
* Additional options that can be used to filter the set of
|
|
252
255
|
* players returned.
|
|
@@ -262,6 +265,8 @@ export class Dimension {
|
|
|
262
265
|
* of 128 asynchronous commands that can be run in a given
|
|
263
266
|
* tick.
|
|
264
267
|
*
|
|
268
|
+
* This function can't be called in read-only mode.
|
|
269
|
+
*
|
|
265
270
|
* @param commandString
|
|
266
271
|
* Command to run. Note that command strings should not start
|
|
267
272
|
* with slash.
|
|
@@ -280,7 +285,6 @@ export class Dimension {
|
|
|
280
285
|
export class Entity {
|
|
281
286
|
protected constructor();
|
|
282
287
|
/**
|
|
283
|
-
* @beta
|
|
284
288
|
* @remarks
|
|
285
289
|
* Dimension that the entity is currently within.
|
|
286
290
|
*
|
|
@@ -298,7 +302,6 @@ export class Entity {
|
|
|
298
302
|
*/
|
|
299
303
|
readonly id: string;
|
|
300
304
|
/**
|
|
301
|
-
* @beta
|
|
302
305
|
* @remarks
|
|
303
306
|
* Current location of the entity.
|
|
304
307
|
*
|
|
@@ -306,7 +309,6 @@ export class Entity {
|
|
|
306
309
|
*/
|
|
307
310
|
readonly location: Vector3;
|
|
308
311
|
/**
|
|
309
|
-
* @beta
|
|
310
312
|
* @remarks
|
|
311
313
|
* Given name of the entity.
|
|
312
314
|
*
|
|
@@ -323,27 +325,30 @@ export class Entity {
|
|
|
323
325
|
*/
|
|
324
326
|
readonly typeId: string;
|
|
325
327
|
/**
|
|
326
|
-
* @beta
|
|
327
328
|
* @remarks
|
|
328
329
|
* Returns the current location of the head component of this
|
|
329
330
|
* entity.
|
|
330
331
|
*
|
|
332
|
+
* This function can't be called in read-only mode.
|
|
333
|
+
*
|
|
331
334
|
* @throws This function can throw errors.
|
|
332
335
|
*/
|
|
333
336
|
getHeadLocation(): Vector3;
|
|
334
337
|
/**
|
|
335
|
-
* @beta
|
|
336
338
|
* @remarks
|
|
337
339
|
* Returns the current velocity vector of the entity.
|
|
338
340
|
*
|
|
341
|
+
* This function can't be called in read-only mode.
|
|
342
|
+
*
|
|
339
343
|
* @throws This function can throw errors.
|
|
340
344
|
*/
|
|
341
345
|
getVelocity(): Vector3;
|
|
342
346
|
/**
|
|
343
|
-
* @beta
|
|
344
347
|
* @remarks
|
|
345
348
|
* Returns the current view direction of the entity.
|
|
346
349
|
*
|
|
350
|
+
* This function can't be called in read-only mode.
|
|
351
|
+
*
|
|
347
352
|
* @throws This function can throw errors.
|
|
348
353
|
*/
|
|
349
354
|
getViewDirection(): Vector3;
|
|
@@ -353,6 +358,8 @@ export class Entity {
|
|
|
353
358
|
* this entity. Note that there is a maximum queue of 128
|
|
354
359
|
* asynchronous commands that can be run in a given tick.
|
|
355
360
|
*
|
|
361
|
+
* This function can't be called in read-only mode.
|
|
362
|
+
*
|
|
356
363
|
* @param commandString
|
|
357
364
|
* Command to run. Note that command strings should not start
|
|
358
365
|
* with slash.
|
|
@@ -417,10 +424,11 @@ export class Player extends Entity {
|
|
|
417
424
|
*/
|
|
418
425
|
readonly name: string;
|
|
419
426
|
/**
|
|
420
|
-
* @beta
|
|
421
427
|
* @remarks
|
|
422
428
|
* Sends a message to the player.
|
|
423
429
|
*
|
|
430
|
+
* This function can't be called in read-only mode.
|
|
431
|
+
*
|
|
424
432
|
* @param message
|
|
425
433
|
* The message to be displayed.
|
|
426
434
|
* @throws
|
|
@@ -467,18 +475,18 @@ export class Player extends Entity {
|
|
|
467
475
|
export class System {
|
|
468
476
|
protected constructor();
|
|
469
477
|
/**
|
|
470
|
-
* @beta
|
|
471
478
|
* @remarks
|
|
472
479
|
* Represents the current world tick of the server.
|
|
473
480
|
*
|
|
474
481
|
*/
|
|
475
482
|
readonly currentTick: number;
|
|
476
483
|
/**
|
|
477
|
-
* @beta
|
|
478
484
|
* @remarks
|
|
479
485
|
* Cancels the execution of a function run that was previously
|
|
480
486
|
* scheduled via the `run` function.
|
|
481
487
|
*
|
|
488
|
+
* This function can't be called in read-only mode.
|
|
489
|
+
*
|
|
482
490
|
*/
|
|
483
491
|
clearRun(runId: number): void;
|
|
484
492
|
/**
|
|
@@ -487,6 +495,8 @@ export class System {
|
|
|
487
495
|
* frequently used to implement delayed behaviors and game
|
|
488
496
|
* loops.
|
|
489
497
|
*
|
|
498
|
+
* This function can't be called in read-only mode.
|
|
499
|
+
*
|
|
490
500
|
* @param callback
|
|
491
501
|
* Function callback to run when the tickDelay time criteria is
|
|
492
502
|
* met.
|
|
@@ -496,10 +506,11 @@ export class System {
|
|
|
496
506
|
*/
|
|
497
507
|
run(callback: () => void): number;
|
|
498
508
|
/**
|
|
499
|
-
* @beta
|
|
500
509
|
* @remarks
|
|
501
510
|
* Runs a set of code on an interval.
|
|
502
511
|
*
|
|
512
|
+
* This function can't be called in read-only mode.
|
|
513
|
+
*
|
|
503
514
|
* @param callback
|
|
504
515
|
* Functional code that will run when this interval occurs.
|
|
505
516
|
* @param tickInterval
|
|
@@ -511,10 +522,11 @@ export class System {
|
|
|
511
522
|
*/
|
|
512
523
|
runInterval(callback: () => void, tickInterval?: number): number;
|
|
513
524
|
/**
|
|
514
|
-
* @beta
|
|
515
525
|
* @remarks
|
|
516
526
|
* Runs a set of code at a future time specified by tickDelay.
|
|
517
527
|
*
|
|
528
|
+
* This function can't be called in read-only mode.
|
|
529
|
+
*
|
|
518
530
|
* @param callback
|
|
519
531
|
* Functional code that will run when this timeout occurs.
|
|
520
532
|
* @param tickDelay
|
|
@@ -537,6 +549,8 @@ export class World {
|
|
|
537
549
|
* @remarks
|
|
538
550
|
* Returns an array of all active players within the world.
|
|
539
551
|
*
|
|
552
|
+
* This function can't be called in read-only mode.
|
|
553
|
+
*
|
|
540
554
|
* @throws This function can throw errors.
|
|
541
555
|
*/
|
|
542
556
|
getAllPlayers(): Player[];
|
|
@@ -544,6 +558,8 @@ export class World {
|
|
|
544
558
|
* @remarks
|
|
545
559
|
* Returns a dimension object.
|
|
546
560
|
*
|
|
561
|
+
* This function can't be called in read-only mode.
|
|
562
|
+
*
|
|
547
563
|
* @returns
|
|
548
564
|
* The requested dimension
|
|
549
565
|
* @throws
|
|
@@ -551,11 +567,12 @@ export class World {
|
|
|
551
567
|
*/
|
|
552
568
|
getDimension(dimensionId: string): Dimension;
|
|
553
569
|
/**
|
|
554
|
-
* @beta
|
|
555
570
|
* @remarks
|
|
556
571
|
* Returns a set of players based on a set of conditions
|
|
557
572
|
* defined via the EntityQueryOptions set of filter criteria.
|
|
558
573
|
*
|
|
574
|
+
* This function can't be called in read-only mode.
|
|
575
|
+
*
|
|
559
576
|
* @param options
|
|
560
577
|
* Additional options that can be used to filter the set of
|
|
561
578
|
* players returned.
|
|
@@ -565,10 +582,11 @@ export class World {
|
|
|
565
582
|
*/
|
|
566
583
|
getPlayers(options?: EntityQueryOptions): Player[];
|
|
567
584
|
/**
|
|
568
|
-
* @beta
|
|
569
585
|
* @remarks
|
|
570
586
|
* Sends a message to all players.
|
|
571
587
|
*
|
|
588
|
+
* This function can't be called in read-only mode.
|
|
589
|
+
*
|
|
572
590
|
* @param message
|
|
573
591
|
* The message to be displayed.
|
|
574
592
|
* @throws
|
|
@@ -610,7 +628,6 @@ export class World {
|
|
|
610
628
|
}
|
|
611
629
|
|
|
612
630
|
/**
|
|
613
|
-
* @beta
|
|
614
631
|
* Contains options for selecting entities within an area.
|
|
615
632
|
*/
|
|
616
633
|
export interface EntityQueryOptions {
|
|
@@ -773,7 +790,6 @@ export interface EntityQueryOptions {
|
|
|
773
790
|
}
|
|
774
791
|
|
|
775
792
|
/**
|
|
776
|
-
* @beta
|
|
777
793
|
* Contains additional options for filtering players based on
|
|
778
794
|
* their score for an objective.
|
|
779
795
|
*/
|
|
@@ -807,9 +823,6 @@ export interface EntityQueryScoreOptions {
|
|
|
807
823
|
objective?: string;
|
|
808
824
|
}
|
|
809
825
|
|
|
810
|
-
/**
|
|
811
|
-
* @beta
|
|
812
|
-
*/
|
|
813
826
|
export interface RawMessage {
|
|
814
827
|
rawtext?: RawMessage[];
|
|
815
828
|
score?: RawMessageScore;
|
|
@@ -818,16 +831,12 @@ export interface RawMessage {
|
|
|
818
831
|
with?: string[] | RawMessage;
|
|
819
832
|
}
|
|
820
833
|
|
|
821
|
-
/**
|
|
822
|
-
* @beta
|
|
823
|
-
*/
|
|
824
834
|
export interface RawMessageScore {
|
|
825
835
|
name?: string;
|
|
826
836
|
objective?: string;
|
|
827
837
|
}
|
|
828
838
|
|
|
829
839
|
/**
|
|
830
|
-
* @beta
|
|
831
840
|
* Contains a description of a vector.
|
|
832
841
|
*/
|
|
833
842
|
export interface Vector3 {
|