@minecraft/server 1.10.0-rc.1.21.0-preview.21 → 1.10.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/index.d.ts +184 -342
- package/package.json +1 -1
package/index.d.ts
CHANGED
|
@@ -15,15 +15,12 @@
|
|
|
15
15
|
* ```json
|
|
16
16
|
* {
|
|
17
17
|
* "module_name": "@minecraft/server",
|
|
18
|
-
* "version": "1.
|
|
18
|
+
* "version": "1.10.0"
|
|
19
19
|
* }
|
|
20
20
|
* ```
|
|
21
21
|
*
|
|
22
22
|
*/
|
|
23
23
|
import * as minecraftcommon from '@minecraft/common';
|
|
24
|
-
/**
|
|
25
|
-
* @beta
|
|
26
|
-
*/
|
|
27
24
|
export enum BlockComponentTypes {
|
|
28
25
|
Inventory = 'minecraft:inventory',
|
|
29
26
|
Piston = 'minecraft:piston',
|
|
@@ -263,9 +260,6 @@ export enum EasingType {
|
|
|
263
260
|
Spring = 'Spring',
|
|
264
261
|
}
|
|
265
262
|
|
|
266
|
-
/**
|
|
267
|
-
* @beta
|
|
268
|
-
*/
|
|
269
263
|
export enum EntityComponentTypes {
|
|
270
264
|
CanClimb = 'minecraft:can_climb',
|
|
271
265
|
CanFly = 'minecraft:can_fly',
|
|
@@ -691,27 +685,23 @@ export enum GameMode {
|
|
|
691
685
|
}
|
|
692
686
|
|
|
693
687
|
/**
|
|
694
|
-
* @beta
|
|
695
688
|
* The types of item components that are accessible via
|
|
696
689
|
* function ItemStack.getComponent.
|
|
697
690
|
*/
|
|
698
691
|
export enum ItemComponentTypes {
|
|
699
692
|
/**
|
|
700
|
-
* @beta
|
|
701
693
|
* @remarks
|
|
702
694
|
* The minecraft:cooldown component.
|
|
703
695
|
*
|
|
704
696
|
*/
|
|
705
697
|
Cooldown = 'minecraft:cooldown',
|
|
706
698
|
/**
|
|
707
|
-
* @beta
|
|
708
699
|
* @remarks
|
|
709
700
|
* The minecraft:durability component.
|
|
710
701
|
*
|
|
711
702
|
*/
|
|
712
703
|
Durability = 'minecraft:durability',
|
|
713
704
|
/**
|
|
714
|
-
* @beta
|
|
715
705
|
* @remarks
|
|
716
706
|
* The minecraft:food component.
|
|
717
707
|
*
|
|
@@ -905,18 +895,12 @@ export enum SignSide {
|
|
|
905
895
|
Front = 'Front',
|
|
906
896
|
}
|
|
907
897
|
|
|
908
|
-
/**
|
|
909
|
-
* @beta
|
|
910
|
-
*/
|
|
911
898
|
export enum StructureAnimationMode {
|
|
912
899
|
Blocks = 'Blocks',
|
|
913
900
|
Layers = 'Layers',
|
|
914
901
|
None = 'None',
|
|
915
902
|
}
|
|
916
903
|
|
|
917
|
-
/**
|
|
918
|
-
* @beta
|
|
919
|
-
*/
|
|
920
904
|
export enum StructureMirrorAxis {
|
|
921
905
|
None = 'None',
|
|
922
906
|
X = 'X',
|
|
@@ -924,9 +908,6 @@ export enum StructureMirrorAxis {
|
|
|
924
908
|
Z = 'Z',
|
|
925
909
|
}
|
|
926
910
|
|
|
927
|
-
/**
|
|
928
|
-
* @beta
|
|
929
|
-
*/
|
|
930
911
|
export enum StructureRotation {
|
|
931
912
|
None = 'None',
|
|
932
913
|
Rotate180 = 'Rotate180',
|
|
@@ -934,9 +915,6 @@ export enum StructureRotation {
|
|
|
934
915
|
Rotate90 = 'Rotate90',
|
|
935
916
|
}
|
|
936
917
|
|
|
937
|
-
/**
|
|
938
|
-
* @beta
|
|
939
|
-
*/
|
|
940
918
|
export enum StructureSaveMode {
|
|
941
919
|
Memory = 'Memory',
|
|
942
920
|
World = 'World',
|
|
@@ -1171,7 +1149,6 @@ export class Block {
|
|
|
1171
1149
|
*/
|
|
1172
1150
|
getComponent(componentId: string): BlockComponent | undefined;
|
|
1173
1151
|
/**
|
|
1174
|
-
* @beta
|
|
1175
1152
|
* @remarks
|
|
1176
1153
|
* Creates a prototype item stack based on this block that can
|
|
1177
1154
|
* be used with Container/ContainerSlot APIs.
|
|
@@ -1436,7 +1413,6 @@ export class BlockPermutation {
|
|
|
1436
1413
|
*/
|
|
1437
1414
|
getAllStates(): Record<string, boolean | number | string>;
|
|
1438
1415
|
/**
|
|
1439
|
-
* @beta
|
|
1440
1416
|
* @remarks
|
|
1441
1417
|
* Retrieves a prototype item stack based on this block
|
|
1442
1418
|
* permutation that can be used with item
|
|
@@ -2837,7 +2813,6 @@ export class Dimension {
|
|
|
2837
2813
|
*
|
|
2838
2814
|
* @param options
|
|
2839
2815
|
* Additional options for processing this raycast query.
|
|
2840
|
-
* @throws This function can throw errors.
|
|
2841
2816
|
*/
|
|
2842
2817
|
getEntitiesFromRay(location: Vector3, direction: Vector3, options?: EntityRaycastOptions): EntityRaycastHit[];
|
|
2843
2818
|
/**
|
|
@@ -3229,6 +3204,7 @@ export class EffectAddBeforeEventSignal {
|
|
|
3229
3204
|
*
|
|
3230
3205
|
* This function can't be called in read-only mode.
|
|
3231
3206
|
*
|
|
3207
|
+
* @throws This function can throw errors.
|
|
3232
3208
|
*/
|
|
3233
3209
|
unsubscribe(callback: (arg: EffectAddBeforeEvent) => void): void;
|
|
3234
3210
|
}
|
|
@@ -5127,6 +5103,7 @@ export class EntityLoadAfterEventSignal {
|
|
|
5127
5103
|
* @param callback
|
|
5128
5104
|
* Original function that was passed into the subscribe event,
|
|
5129
5105
|
* that is to be unregistered.
|
|
5106
|
+
* @throws This function can throw errors.
|
|
5130
5107
|
*/
|
|
5131
5108
|
unsubscribe(callback: (arg: EntityLoadAfterEvent) => void): void;
|
|
5132
5109
|
}
|
|
@@ -5250,7 +5227,6 @@ export class EntityOnFireComponent extends EntityComponent {
|
|
|
5250
5227
|
}
|
|
5251
5228
|
|
|
5252
5229
|
/**
|
|
5253
|
-
* @beta
|
|
5254
5230
|
* The projectile component controls the properties of a
|
|
5255
5231
|
* projectile entity and allows it to be shot in a given
|
|
5256
5232
|
* direction.
|
|
@@ -5541,6 +5517,7 @@ export class EntityRemoveBeforeEventSignal {
|
|
|
5541
5517
|
*
|
|
5542
5518
|
* This function can't be called in read-only mode.
|
|
5543
5519
|
*
|
|
5520
|
+
* @throws This function can throw errors.
|
|
5544
5521
|
*/
|
|
5545
5522
|
unsubscribe(callback: (arg: EntityRemoveBeforeEvent) => void): void;
|
|
5546
5523
|
}
|
|
@@ -5653,12 +5630,12 @@ export class EntitySpawnAfterEventSignal {
|
|
|
5653
5630
|
* @param callback
|
|
5654
5631
|
* Original function that was passed into the subscribe event,
|
|
5655
5632
|
* that is to be unregistered.
|
|
5633
|
+
* @throws This function can throw errors.
|
|
5656
5634
|
*/
|
|
5657
5635
|
unsubscribe(callback: (arg: EntitySpawnAfterEvent) => void): void;
|
|
5658
5636
|
}
|
|
5659
5637
|
|
|
5660
5638
|
/**
|
|
5661
|
-
* @beta
|
|
5662
5639
|
* Represents information about a type of entity.
|
|
5663
5640
|
*/
|
|
5664
5641
|
export class EntityType {
|
|
@@ -5672,9 +5649,6 @@ export class EntityType {
|
|
|
5672
5649
|
readonly id: string;
|
|
5673
5650
|
}
|
|
5674
5651
|
|
|
5675
|
-
/**
|
|
5676
|
-
* @beta
|
|
5677
|
-
*/
|
|
5678
5652
|
// @ts-ignore Class inheritance allowed for native defined classes
|
|
5679
5653
|
export class EntityTypeFamilyComponent extends EntityComponent {
|
|
5680
5654
|
private constructor();
|
|
@@ -5690,7 +5664,6 @@ export class EntityTypeFamilyComponent extends EntityComponent {
|
|
|
5690
5664
|
}
|
|
5691
5665
|
|
|
5692
5666
|
/**
|
|
5693
|
-
* @beta
|
|
5694
5667
|
* Used for accessing all entity types currently available for
|
|
5695
5668
|
* use within the world.
|
|
5696
5669
|
*/
|
|
@@ -5786,6 +5759,7 @@ export class ExplosionAfterEventSignal {
|
|
|
5786
5759
|
*
|
|
5787
5760
|
* This function can't be called in read-only mode.
|
|
5788
5761
|
*
|
|
5762
|
+
* @throws This function can throw errors.
|
|
5789
5763
|
*/
|
|
5790
5764
|
unsubscribe(callback: (arg: ExplosionAfterEvent) => void): void;
|
|
5791
5765
|
}
|
|
@@ -5837,6 +5811,7 @@ export class ExplosionBeforeEventSignal {
|
|
|
5837
5811
|
*
|
|
5838
5812
|
* This function can't be called in read-only mode.
|
|
5839
5813
|
*
|
|
5814
|
+
* @throws This function can throw errors.
|
|
5840
5815
|
*/
|
|
5841
5816
|
unsubscribe(callback: (arg: ExplosionBeforeEvent) => void): void;
|
|
5842
5817
|
}
|
|
@@ -5928,6 +5903,7 @@ export class IButtonPushAfterEventSignal {
|
|
|
5928
5903
|
*
|
|
5929
5904
|
* This function can't be called in read-only mode.
|
|
5930
5905
|
*
|
|
5906
|
+
* @throws This function can throw errors.
|
|
5931
5907
|
*/
|
|
5932
5908
|
unsubscribe(callback: (arg: ButtonPushAfterEvent) => void): void;
|
|
5933
5909
|
}
|
|
@@ -5952,6 +5928,7 @@ export class ILeverActionAfterEventSignal {
|
|
|
5952
5928
|
*
|
|
5953
5929
|
* This function can't be called in read-only mode.
|
|
5954
5930
|
*
|
|
5931
|
+
* @throws This function can throw errors.
|
|
5955
5932
|
*/
|
|
5956
5933
|
unsubscribe(callback: (arg: LeverActionAfterEvent) => void): void;
|
|
5957
5934
|
}
|
|
@@ -5976,6 +5953,7 @@ export class IPlayerJoinAfterEventSignal {
|
|
|
5976
5953
|
*
|
|
5977
5954
|
* This function can't be called in read-only mode.
|
|
5978
5955
|
*
|
|
5956
|
+
* @throws This function can throw errors.
|
|
5979
5957
|
*/
|
|
5980
5958
|
unsubscribe(callback: (arg: PlayerJoinAfterEvent) => void): void;
|
|
5981
5959
|
}
|
|
@@ -6000,6 +5978,7 @@ export class IPlayerLeaveAfterEventSignal {
|
|
|
6000
5978
|
*
|
|
6001
5979
|
* This function can't be called in read-only mode.
|
|
6002
5980
|
*
|
|
5981
|
+
* @throws This function can throw errors.
|
|
6003
5982
|
*/
|
|
6004
5983
|
unsubscribe(callback: (arg: PlayerLeaveAfterEvent) => void): void;
|
|
6005
5984
|
}
|
|
@@ -6024,6 +6003,7 @@ export class IPlayerSpawnAfterEventSignal {
|
|
|
6024
6003
|
*
|
|
6025
6004
|
* This function can't be called in read-only mode.
|
|
6026
6005
|
*
|
|
6006
|
+
* @throws This function can throw errors.
|
|
6027
6007
|
*/
|
|
6028
6008
|
unsubscribe(callback: (arg: PlayerSpawnAfterEvent) => void): void;
|
|
6029
6009
|
}
|
|
@@ -6077,6 +6057,7 @@ export class ItemCompleteUseAfterEventSignal {
|
|
|
6077
6057
|
*
|
|
6078
6058
|
* This function can't be called in read-only mode.
|
|
6079
6059
|
*
|
|
6060
|
+
* @throws This function can throw errors.
|
|
6080
6061
|
*/
|
|
6081
6062
|
unsubscribe(callback: (arg: ItemCompleteUseAfterEvent) => void): void;
|
|
6082
6063
|
}
|
|
@@ -6090,7 +6071,6 @@ export class ItemComponent extends Component {
|
|
|
6090
6071
|
}
|
|
6091
6072
|
|
|
6092
6073
|
/**
|
|
6093
|
-
* @beta
|
|
6094
6074
|
* When present on an item, this item has a cooldown effect
|
|
6095
6075
|
* when used by entities.
|
|
6096
6076
|
*/
|
|
@@ -6294,6 +6274,7 @@ export class ItemReleaseUseAfterEventSignal {
|
|
|
6294
6274
|
*
|
|
6295
6275
|
* This function can't be called in read-only mode.
|
|
6296
6276
|
*
|
|
6277
|
+
* @throws This function can throw errors.
|
|
6297
6278
|
*/
|
|
6298
6279
|
unsubscribe(callback: (arg: ItemReleaseUseAfterEvent) => void): void;
|
|
6299
6280
|
}
|
|
@@ -6303,7 +6284,7 @@ export class ItemReleaseUseAfterEventSignal {
|
|
|
6303
6284
|
* @example givePlayerIronFireSword.ts
|
|
6304
6285
|
* ```typescript
|
|
6305
6286
|
* // Spawns a bunch of item stacks
|
|
6306
|
-
* import {
|
|
6287
|
+
* import { ItemComponentTypes, ItemStack, Player } from '@minecraft/server';
|
|
6307
6288
|
* import { MinecraftItemTypes, MinecraftEnchantmentTypes } from '@minecraft/vanilla-data';
|
|
6308
6289
|
*
|
|
6309
6290
|
* function giveFireSword(player: Player) {
|
|
@@ -6311,7 +6292,7 @@ export class ItemReleaseUseAfterEventSignal {
|
|
|
6311
6292
|
*
|
|
6312
6293
|
* const enchantments = ironFireSword?.getComponent(ItemComponentTypes.Enchantable);
|
|
6313
6294
|
* if (enchantments) {
|
|
6314
|
-
* enchantments.addEnchantment({ type:
|
|
6295
|
+
* enchantments.addEnchantment({ type: MinecraftEnchantmentTypes.FireAspect, level: 1 });
|
|
6315
6296
|
* }
|
|
6316
6297
|
*
|
|
6317
6298
|
* const inventory = player.getComponent('minecraft:inventory');
|
|
@@ -6774,6 +6755,7 @@ export class ItemStartUseAfterEventSignal {
|
|
|
6774
6755
|
*
|
|
6775
6756
|
* This function can't be called in read-only mode.
|
|
6776
6757
|
*
|
|
6758
|
+
* @throws This function can throw errors.
|
|
6777
6759
|
*/
|
|
6778
6760
|
unsubscribe(callback: (arg: ItemStartUseAfterEvent) => void): void;
|
|
6779
6761
|
}
|
|
@@ -6838,6 +6820,7 @@ export class ItemStartUseOnAfterEventSignal {
|
|
|
6838
6820
|
*
|
|
6839
6821
|
* This function can't be called in read-only mode.
|
|
6840
6822
|
*
|
|
6823
|
+
* @throws This function can throw errors.
|
|
6841
6824
|
*/
|
|
6842
6825
|
unsubscribe(callback: (arg: ItemStartUseOnAfterEvent) => void): void;
|
|
6843
6826
|
}
|
|
@@ -6895,6 +6878,7 @@ export class ItemStopUseAfterEventSignal {
|
|
|
6895
6878
|
*
|
|
6896
6879
|
* This function can't be called in read-only mode.
|
|
6897
6880
|
*
|
|
6881
|
+
* @throws This function can throw errors.
|
|
6898
6882
|
*/
|
|
6899
6883
|
unsubscribe(callback: (arg: ItemStopUseAfterEvent) => void): void;
|
|
6900
6884
|
}
|
|
@@ -6952,6 +6936,7 @@ export class ItemStopUseOnAfterEventSignal {
|
|
|
6952
6936
|
*
|
|
6953
6937
|
* This function can't be called in read-only mode.
|
|
6954
6938
|
*
|
|
6939
|
+
* @throws This function can throw errors.
|
|
6955
6940
|
*/
|
|
6956
6941
|
unsubscribe(callback: (arg: ItemStopUseOnAfterEvent) => void): void;
|
|
6957
6942
|
}
|
|
@@ -7010,6 +6995,7 @@ export class ItemUseAfterEventSignal {
|
|
|
7010
6995
|
*
|
|
7011
6996
|
* This function can't be called in read-only mode.
|
|
7012
6997
|
*
|
|
6998
|
+
* @throws This function can throw errors.
|
|
7013
6999
|
*/
|
|
7014
7000
|
unsubscribe(callback: (arg: ItemUseAfterEvent) => void): void;
|
|
7015
7001
|
}
|
|
@@ -7047,6 +7033,7 @@ export class ItemUseBeforeEventSignal {
|
|
|
7047
7033
|
*
|
|
7048
7034
|
* This function can't be called in read-only mode.
|
|
7049
7035
|
*
|
|
7036
|
+
* @throws This function can throw errors.
|
|
7050
7037
|
*/
|
|
7051
7038
|
unsubscribe(callback: (arg: ItemUseBeforeEvent) => void): void;
|
|
7052
7039
|
}
|
|
@@ -7113,6 +7100,7 @@ export class ItemUseOnAfterEventSignal {
|
|
|
7113
7100
|
*
|
|
7114
7101
|
* This function can't be called in read-only mode.
|
|
7115
7102
|
*
|
|
7103
|
+
* @throws This function can throw errors.
|
|
7116
7104
|
*/
|
|
7117
7105
|
unsubscribe(callback: (arg: ItemUseOnAfterEvent) => void): void;
|
|
7118
7106
|
}
|
|
@@ -7154,6 +7142,7 @@ export class ItemUseOnBeforeEventSignal {
|
|
|
7154
7142
|
*
|
|
7155
7143
|
* This function can't be called in read-only mode.
|
|
7156
7144
|
*
|
|
7145
|
+
* @throws This function can throw errors.
|
|
7157
7146
|
*/
|
|
7158
7147
|
unsubscribe(callback: (arg: ItemUseOnBeforeEvent) => void): void;
|
|
7159
7148
|
}
|
|
@@ -7380,6 +7369,7 @@ export class PistonActivateAfterEventSignal {
|
|
|
7380
7369
|
*
|
|
7381
7370
|
* This function can't be called in read-only mode.
|
|
7382
7371
|
*
|
|
7372
|
+
* @throws This function can throw errors.
|
|
7383
7373
|
*/
|
|
7384
7374
|
unsubscribe(callback: (arg: PistonActivateAfterEvent) => void): void;
|
|
7385
7375
|
}
|
|
@@ -7509,7 +7499,6 @@ export class Player extends Entity {
|
|
|
7509
7499
|
*/
|
|
7510
7500
|
getTotalXp(): number;
|
|
7511
7501
|
/**
|
|
7512
|
-
* @beta
|
|
7513
7502
|
* @remarks
|
|
7514
7503
|
* Plays a music track that only this particular player can
|
|
7515
7504
|
* hear.
|
|
@@ -7535,7 +7524,6 @@ export class Player extends Entity {
|
|
|
7535
7524
|
*/
|
|
7536
7525
|
playSound(soundId: string, soundOptions?: PlayerSoundOptions): void;
|
|
7537
7526
|
/**
|
|
7538
|
-
* @beta
|
|
7539
7527
|
* @remarks
|
|
7540
7528
|
* Queues an additional music track that only this particular
|
|
7541
7529
|
* player can hear. If a track is not playing, a music track
|
|
@@ -7616,7 +7604,6 @@ export class Player extends Entity {
|
|
|
7616
7604
|
*/
|
|
7617
7605
|
setSpawnPoint(spawnPoint?: DimensionLocation): void;
|
|
7618
7606
|
/**
|
|
7619
|
-
* @beta
|
|
7620
7607
|
* @remarks
|
|
7621
7608
|
* Stops any music tracks from playing for this particular
|
|
7622
7609
|
* player.
|
|
@@ -7689,6 +7676,7 @@ export class PlayerBreakBlockAfterEventSignal {
|
|
|
7689
7676
|
*
|
|
7690
7677
|
* This function can't be called in read-only mode.
|
|
7691
7678
|
*
|
|
7679
|
+
* @throws This function can throw errors.
|
|
7692
7680
|
*/
|
|
7693
7681
|
unsubscribe(callback: (arg: PlayerBreakBlockAfterEvent) => void): void;
|
|
7694
7682
|
}
|
|
@@ -7746,6 +7734,7 @@ export class PlayerBreakBlockBeforeEventSignal {
|
|
|
7746
7734
|
*
|
|
7747
7735
|
* This function can't be called in read-only mode.
|
|
7748
7736
|
*
|
|
7737
|
+
* @throws This function can throw errors.
|
|
7749
7738
|
*/
|
|
7750
7739
|
unsubscribe(callback: (arg: PlayerBreakBlockBeforeEvent) => void): void;
|
|
7751
7740
|
}
|
|
@@ -7811,6 +7800,7 @@ export class PlayerDimensionChangeAfterEventSignal {
|
|
|
7811
7800
|
*
|
|
7812
7801
|
* This function can't be called in read-only mode.
|
|
7813
7802
|
*
|
|
7803
|
+
* @throws This function can throw errors.
|
|
7814
7804
|
*/
|
|
7815
7805
|
unsubscribe(callback: (arg: PlayerDimensionChangeAfterEvent) => void): void;
|
|
7816
7806
|
}
|
|
@@ -7879,6 +7869,7 @@ export class PlayerInteractWithBlockAfterEventSignal {
|
|
|
7879
7869
|
*
|
|
7880
7870
|
* This function can't be called in read-only mode.
|
|
7881
7871
|
*
|
|
7872
|
+
* @throws This function can throw errors.
|
|
7882
7873
|
*/
|
|
7883
7874
|
unsubscribe(callback: (arg: PlayerInteractWithBlockAfterEvent) => void): void;
|
|
7884
7875
|
}
|
|
@@ -7953,6 +7944,7 @@ export class PlayerInteractWithBlockBeforeEventSignal {
|
|
|
7953
7944
|
*
|
|
7954
7945
|
* This function can't be called in read-only mode.
|
|
7955
7946
|
*
|
|
7947
|
+
* @throws This function can throw errors.
|
|
7956
7948
|
*/
|
|
7957
7949
|
unsubscribe(callback: (arg: PlayerInteractWithBlockBeforeEvent) => void): void;
|
|
7958
7950
|
}
|
|
@@ -8008,6 +8000,7 @@ export class PlayerInteractWithEntityAfterEventSignal {
|
|
|
8008
8000
|
*
|
|
8009
8001
|
* This function can't be called in read-only mode.
|
|
8010
8002
|
*
|
|
8003
|
+
* @throws This function can throw errors.
|
|
8011
8004
|
*/
|
|
8012
8005
|
unsubscribe(callback: (arg: PlayerInteractWithEntityAfterEvent) => void): void;
|
|
8013
8006
|
}
|
|
@@ -8069,6 +8062,7 @@ export class PlayerInteractWithEntityBeforeEventSignal {
|
|
|
8069
8062
|
*
|
|
8070
8063
|
* This function can't be called in read-only mode.
|
|
8071
8064
|
*
|
|
8065
|
+
* @throws This function can throw errors.
|
|
8072
8066
|
*/
|
|
8073
8067
|
unsubscribe(callback: (arg: PlayerInteractWithEntityBeforeEvent) => void): void;
|
|
8074
8068
|
}
|
|
@@ -8170,6 +8164,7 @@ export class PlayerLeaveBeforeEventSignal {
|
|
|
8170
8164
|
*
|
|
8171
8165
|
* This function can't be called in read-only mode.
|
|
8172
8166
|
*
|
|
8167
|
+
* @throws This function can throw errors.
|
|
8173
8168
|
*/
|
|
8174
8169
|
unsubscribe(callback: (arg: PlayerLeaveBeforeEvent) => void): void;
|
|
8175
8170
|
}
|
|
@@ -8214,6 +8209,7 @@ export class PlayerPlaceBlockAfterEventSignal {
|
|
|
8214
8209
|
*
|
|
8215
8210
|
* This function can't be called in read-only mode.
|
|
8216
8211
|
*
|
|
8212
|
+
* @throws This function can throw errors.
|
|
8217
8213
|
*/
|
|
8218
8214
|
unsubscribe(callback: (arg: PlayerPlaceBlockAfterEvent) => void): void;
|
|
8219
8215
|
}
|
|
@@ -8297,6 +8293,7 @@ export class PressurePlatePopAfterEventSignal {
|
|
|
8297
8293
|
*
|
|
8298
8294
|
* This function can't be called in read-only mode.
|
|
8299
8295
|
*
|
|
8296
|
+
* @throws This function can throw errors.
|
|
8300
8297
|
*/
|
|
8301
8298
|
unsubscribe(callback: (arg: PressurePlatePopAfterEvent) => void): void;
|
|
8302
8299
|
}
|
|
@@ -8352,6 +8349,7 @@ export class PressurePlatePushAfterEventSignal {
|
|
|
8352
8349
|
*
|
|
8353
8350
|
* This function can't be called in read-only mode.
|
|
8354
8351
|
*
|
|
8352
|
+
* @throws This function can throw errors.
|
|
8355
8353
|
*/
|
|
8356
8354
|
unsubscribe(callback: (arg: PressurePlatePushAfterEvent) => void): void;
|
|
8357
8355
|
}
|
|
@@ -8425,6 +8423,7 @@ export class ProjectileHitBlockAfterEventSignal {
|
|
|
8425
8423
|
*
|
|
8426
8424
|
* This function can't be called in read-only mode.
|
|
8427
8425
|
*
|
|
8426
|
+
* @throws This function can throw errors.
|
|
8428
8427
|
*/
|
|
8429
8428
|
unsubscribe(callback: (arg: ProjectileHitBlockAfterEvent) => void): void;
|
|
8430
8429
|
}
|
|
@@ -8498,6 +8497,7 @@ export class ProjectileHitEntityAfterEventSignal {
|
|
|
8498
8497
|
*
|
|
8499
8498
|
* This function can't be called in read-only mode.
|
|
8500
8499
|
*
|
|
8500
|
+
* @throws This function can throw errors.
|
|
8501
8501
|
*/
|
|
8502
8502
|
unsubscribe(callback: (arg: ProjectileHitEntityAfterEvent) => void): void;
|
|
8503
8503
|
}
|
|
@@ -8952,7 +8952,6 @@ export class ScriptEventCommandMessageAfterEventSignal {
|
|
|
8952
8952
|
}
|
|
8953
8953
|
|
|
8954
8954
|
/**
|
|
8955
|
-
* @beta
|
|
8956
8955
|
* Represents a loaded structure template (.mcstructure file).
|
|
8957
8956
|
* Structures can be placed in a world using the /structure
|
|
8958
8957
|
* command or the {@link StructureManager} APIs.
|
|
@@ -9029,7 +9028,6 @@ export class Structure {
|
|
|
9029
9028
|
}
|
|
9030
9029
|
|
|
9031
9030
|
/**
|
|
9032
|
-
* @beta
|
|
9033
9031
|
* Manager for Structure related APIs. Includes APIs for
|
|
9034
9032
|
* creating, getting, placing and deleting Structures.
|
|
9035
9033
|
*/
|
|
@@ -9301,6 +9299,7 @@ export class TargetBlockHitAfterEventSignal {
|
|
|
9301
9299
|
*
|
|
9302
9300
|
* This function can't be called in read-only mode.
|
|
9303
9301
|
*
|
|
9302
|
+
* @throws This function can throw errors.
|
|
9304
9303
|
*/
|
|
9305
9304
|
unsubscribe(callback: (arg: TargetBlockHitAfterEvent) => void): void;
|
|
9306
9305
|
}
|
|
@@ -9409,6 +9408,7 @@ export class TripWireTripAfterEventSignal {
|
|
|
9409
9408
|
*
|
|
9410
9409
|
* This function can't be called in read-only mode.
|
|
9411
9410
|
*
|
|
9411
|
+
* @throws This function can throw errors.
|
|
9412
9412
|
*/
|
|
9413
9413
|
unsubscribe(callback: (arg: TripWireTripAfterEvent) => void): void;
|
|
9414
9414
|
}
|
|
@@ -9458,6 +9458,7 @@ export class WeatherChangeAfterEventSignal {
|
|
|
9458
9458
|
*
|
|
9459
9459
|
* This function can't be called in read-only mode.
|
|
9460
9460
|
*
|
|
9461
|
+
* @throws This function can throw errors.
|
|
9461
9462
|
*/
|
|
9462
9463
|
unsubscribe(callback: (arg: WeatherChangeAfterEvent) => void): void;
|
|
9463
9464
|
}
|
|
@@ -9492,7 +9493,6 @@ export class World {
|
|
|
9492
9493
|
*/
|
|
9493
9494
|
readonly scoreboard: Scoreboard;
|
|
9494
9495
|
/**
|
|
9495
|
-
* @beta
|
|
9496
9496
|
* @remarks
|
|
9497
9497
|
* Returns the manager for {@link Structure} related APIs.
|
|
9498
9498
|
*
|
|
@@ -10204,7 +10204,6 @@ export class WorldAfterEvents {
|
|
|
10204
10204
|
*/
|
|
10205
10205
|
readonly weatherChange: WeatherChangeAfterEventSignal;
|
|
10206
10206
|
/**
|
|
10207
|
-
* @beta
|
|
10208
10207
|
* @remarks
|
|
10209
10208
|
* This event fires when the script environment is initialized
|
|
10210
10209
|
* on a World.
|
|
@@ -10271,7 +10270,6 @@ export class WorldBeforeEvents {
|
|
|
10271
10270
|
}
|
|
10272
10271
|
|
|
10273
10272
|
/**
|
|
10274
|
-
* @beta
|
|
10275
10273
|
* Contains information and methods that can be used at the
|
|
10276
10274
|
* initialization of the scripting environment for a World.
|
|
10277
10275
|
*/
|
|
@@ -10280,7 +10278,6 @@ export class WorldInitializeAfterEvent {
|
|
|
10280
10278
|
}
|
|
10281
10279
|
|
|
10282
10280
|
/**
|
|
10283
|
-
* @beta
|
|
10284
10281
|
* Manages callbacks that are run on the first tick of the
|
|
10285
10282
|
* World. Do note that this event may run multiple times within
|
|
10286
10283
|
* a session in the case that the /reload command is used.
|
|
@@ -10303,6 +10300,7 @@ export class WorldInitializeAfterEventSignal {
|
|
|
10303
10300
|
*
|
|
10304
10301
|
* This function can't be called in read-only mode.
|
|
10305
10302
|
*
|
|
10303
|
+
* @throws This function can throw errors.
|
|
10306
10304
|
*/
|
|
10307
10305
|
unsubscribe(callback: (arg: WorldInitializeAfterEvent) => void): void;
|
|
10308
10306
|
}
|
|
@@ -10327,15 +10325,6 @@ export interface BlockEventOptions {
|
|
|
10327
10325
|
permutations?: BlockPermutation[];
|
|
10328
10326
|
}
|
|
10329
10327
|
|
|
10330
|
-
export interface BlockFilter {
|
|
10331
|
-
excludePermutations?: BlockPermutation[];
|
|
10332
|
-
excludeTags?: string[];
|
|
10333
|
-
excludeTypes?: string[];
|
|
10334
|
-
includePermutations?: BlockPermutation[];
|
|
10335
|
-
includeTags?: string[];
|
|
10336
|
-
includeTypes?: string[];
|
|
10337
|
-
}
|
|
10338
|
-
|
|
10339
10328
|
/**
|
|
10340
10329
|
* Contains more information for events where a block is hit.
|
|
10341
10330
|
*/
|
|
@@ -10390,8 +10379,7 @@ export interface BlockRaycastHit {
|
|
|
10390
10379
|
* Contains additional options for configuring a block raycast
|
|
10391
10380
|
* query.
|
|
10392
10381
|
*/
|
|
10393
|
-
|
|
10394
|
-
export interface BlockRaycastOptions extends BlockFilter {
|
|
10382
|
+
export interface BlockRaycastOptions {
|
|
10395
10383
|
/**
|
|
10396
10384
|
* @remarks
|
|
10397
10385
|
* If true, liquid blocks will be considered as blocks that
|
|
@@ -10688,127 +10676,6 @@ export interface EntityEventOptions {
|
|
|
10688
10676
|
entityTypes?: string[];
|
|
10689
10677
|
}
|
|
10690
10678
|
|
|
10691
|
-
/**
|
|
10692
|
-
* Contains options for filtering entities.
|
|
10693
|
-
*/
|
|
10694
|
-
export interface EntityFilter {
|
|
10695
|
-
/**
|
|
10696
|
-
* @remarks
|
|
10697
|
-
* Excludes entities that match one or more of the specified
|
|
10698
|
-
* families.
|
|
10699
|
-
*
|
|
10700
|
-
*/
|
|
10701
|
-
excludeFamilies?: string[];
|
|
10702
|
-
/**
|
|
10703
|
-
* @remarks
|
|
10704
|
-
* Excludes entities if have a specific gamemode that matches
|
|
10705
|
-
* the specified gamemode.
|
|
10706
|
-
*
|
|
10707
|
-
*/
|
|
10708
|
-
excludeGameModes?: GameMode[];
|
|
10709
|
-
/**
|
|
10710
|
-
* @remarks
|
|
10711
|
-
* Excludes entities that have a name that match one of the
|
|
10712
|
-
* specified values.
|
|
10713
|
-
*
|
|
10714
|
-
*/
|
|
10715
|
-
excludeNames?: string[];
|
|
10716
|
-
/**
|
|
10717
|
-
* @remarks
|
|
10718
|
-
* Excludes entities with a tag that matches one of the
|
|
10719
|
-
* specified values.
|
|
10720
|
-
*
|
|
10721
|
-
*/
|
|
10722
|
-
excludeTags?: string[];
|
|
10723
|
-
/**
|
|
10724
|
-
* @remarks
|
|
10725
|
-
* Excludes entities if they are one of the specified types.
|
|
10726
|
-
*
|
|
10727
|
-
*/
|
|
10728
|
-
excludeTypes?: string[];
|
|
10729
|
-
/**
|
|
10730
|
-
* @remarks
|
|
10731
|
-
* If specified, includes entities that match all of the
|
|
10732
|
-
* specified families.
|
|
10733
|
-
*
|
|
10734
|
-
*/
|
|
10735
|
-
families?: string[];
|
|
10736
|
-
/**
|
|
10737
|
-
* @remarks
|
|
10738
|
-
* If specified, includes entities with a gamemode that matches
|
|
10739
|
-
* the specified gamemode.
|
|
10740
|
-
*
|
|
10741
|
-
*/
|
|
10742
|
-
gameMode?: GameMode;
|
|
10743
|
-
/**
|
|
10744
|
-
* @remarks
|
|
10745
|
-
* If specified, will only include entities that have at most
|
|
10746
|
-
* this horizontal rotation.
|
|
10747
|
-
*
|
|
10748
|
-
*/
|
|
10749
|
-
maxHorizontalRotation?: number;
|
|
10750
|
-
/**
|
|
10751
|
-
* @remarks
|
|
10752
|
-
* If defined, only players that have at most this level are
|
|
10753
|
-
* returned.
|
|
10754
|
-
*
|
|
10755
|
-
*/
|
|
10756
|
-
maxLevel?: number;
|
|
10757
|
-
/**
|
|
10758
|
-
* @remarks
|
|
10759
|
-
* If specified, only entities that have at most this vertical
|
|
10760
|
-
* rotation are returned.
|
|
10761
|
-
*
|
|
10762
|
-
*/
|
|
10763
|
-
maxVerticalRotation?: number;
|
|
10764
|
-
/**
|
|
10765
|
-
* @remarks
|
|
10766
|
-
* If specified, will only include entities that have at a
|
|
10767
|
-
* minimum this horizontal rotation.
|
|
10768
|
-
*
|
|
10769
|
-
*/
|
|
10770
|
-
minHorizontalRotation?: number;
|
|
10771
|
-
/**
|
|
10772
|
-
* @remarks
|
|
10773
|
-
* If defined, only players that have at least this level are
|
|
10774
|
-
* returned.
|
|
10775
|
-
*
|
|
10776
|
-
*/
|
|
10777
|
-
minLevel?: number;
|
|
10778
|
-
/**
|
|
10779
|
-
* @remarks
|
|
10780
|
-
* If specified, will only include entities that have at least
|
|
10781
|
-
* this vertical rotation.
|
|
10782
|
-
*
|
|
10783
|
-
*/
|
|
10784
|
-
minVerticalRotation?: number;
|
|
10785
|
-
/**
|
|
10786
|
-
* @remarks
|
|
10787
|
-
* Includes entities with the specified name.
|
|
10788
|
-
*
|
|
10789
|
-
*/
|
|
10790
|
-
name?: string;
|
|
10791
|
-
/**
|
|
10792
|
-
* @remarks
|
|
10793
|
-
* Gets/sets a collection of EntityQueryScoreOptions objects
|
|
10794
|
-
* with filters for specific scoreboard objectives.
|
|
10795
|
-
*
|
|
10796
|
-
*/
|
|
10797
|
-
scoreOptions?: EntityQueryScoreOptions[];
|
|
10798
|
-
/**
|
|
10799
|
-
* @remarks
|
|
10800
|
-
* Includes entities that match all of the specified tags.
|
|
10801
|
-
*
|
|
10802
|
-
*/
|
|
10803
|
-
tags?: string[];
|
|
10804
|
-
/**
|
|
10805
|
-
* @remarks
|
|
10806
|
-
* If defined, entities that match this type are included.
|
|
10807
|
-
*
|
|
10808
|
-
*/
|
|
10809
|
-
type?: string;
|
|
10810
|
-
}
|
|
10811
|
-
|
|
10812
10679
|
/**
|
|
10813
10680
|
* Contains additional information about an entity that was
|
|
10814
10681
|
* hit.
|
|
@@ -10877,162 +10744,6 @@ export interface EntityHitInformation {
|
|
|
10877
10744
|
* });
|
|
10878
10745
|
* }
|
|
10879
10746
|
* ```
|
|
10880
|
-
* @example testPropertyOptionsWithEqualsComparison.ts
|
|
10881
|
-
* ```typescript
|
|
10882
|
-
* import { world, EntityQueryOptions } from '@minecraft/server';
|
|
10883
|
-
*
|
|
10884
|
-
* // Having this command:
|
|
10885
|
-
*
|
|
10886
|
-
* // execute as @e[has_property={propId=propValue}]
|
|
10887
|
-
*
|
|
10888
|
-
* // Equivalent scripting code would be:
|
|
10889
|
-
* function findEntitiesHavingPropertyEqualsTo(propId: string, propValue: boolean | number | string) {
|
|
10890
|
-
* const queryOption: EntityQueryOptions = {
|
|
10891
|
-
* propertyOptions: [{ propertyId: propId, value: { equals: propValue } }]
|
|
10892
|
-
* };
|
|
10893
|
-
*
|
|
10894
|
-
* const overworld = world.getDimension('overworld');
|
|
10895
|
-
* const entities = overworld.getEntities(queryOption);
|
|
10896
|
-
* }
|
|
10897
|
-
* ```
|
|
10898
|
-
* @example testPropertyOptionsWithGreaterThanComparison.ts
|
|
10899
|
-
* ```typescript
|
|
10900
|
-
* import { world, EntityQueryOptions } from '@minecraft/server';
|
|
10901
|
-
*
|
|
10902
|
-
* // No equivalent commands as `propValue..` is inclusive in commands
|
|
10903
|
-
*
|
|
10904
|
-
* function findEntitiesHavingPropertyGreaterThan(propId: string, propValue: number) {
|
|
10905
|
-
* const queryOption: EntityQueryOptions = {
|
|
10906
|
-
* propertyOptions: [{ propertyId: propId, value: { greaterThan: propValue } }]
|
|
10907
|
-
* };
|
|
10908
|
-
*
|
|
10909
|
-
* const overworld = world.getDimension('overworld');
|
|
10910
|
-
* const entities = overworld.getEntities(queryOption);
|
|
10911
|
-
* }
|
|
10912
|
-
* ```
|
|
10913
|
-
* @example testPropertyOptionsWithGreaterThanOrEqualsComparison.ts
|
|
10914
|
-
* ```typescript
|
|
10915
|
-
* import { world, EntityQueryOptions } from '@minecraft/server';
|
|
10916
|
-
*
|
|
10917
|
-
* // Having this command:
|
|
10918
|
-
*
|
|
10919
|
-
* // execute as @e[has_property={propId=propValue..}]
|
|
10920
|
-
*
|
|
10921
|
-
* // Equivalent scripting code would be:
|
|
10922
|
-
* function findEntitiesHavingPropertyGreaterThanOrEqualsTo(propId: string, propValue: number) {
|
|
10923
|
-
* const queryOption: EntityQueryOptions = {
|
|
10924
|
-
* propertyOptions: [{ propertyId: propId, value: { greaterThanOrEquals: propValue } }]
|
|
10925
|
-
* };
|
|
10926
|
-
*
|
|
10927
|
-
* const overworld = world.getDimension('overworld');
|
|
10928
|
-
* const entities = overworld.getEntities(queryOption);
|
|
10929
|
-
* }
|
|
10930
|
-
* ```
|
|
10931
|
-
* @example testPropertyOptionsWithHavingAProperty.ts
|
|
10932
|
-
* ```typescript
|
|
10933
|
-
* import { world, EntityQueryOptions } from '@minecraft/server';
|
|
10934
|
-
*
|
|
10935
|
-
* // Having this command:
|
|
10936
|
-
*
|
|
10937
|
-
* // execute as @e[has_property={property=propId}]
|
|
10938
|
-
*
|
|
10939
|
-
* // Equivalent scripting code would be:
|
|
10940
|
-
* function findEntitiesHavingAProperty(propId: string) {
|
|
10941
|
-
* const queryOption: EntityQueryOptions = {
|
|
10942
|
-
* propertyOptions: [{ propertyId: propId }]
|
|
10943
|
-
* };
|
|
10944
|
-
*
|
|
10945
|
-
* const overworld = world.getDimension('overworld');
|
|
10946
|
-
* const entities = overworld.getEntities(queryOption);
|
|
10947
|
-
* }
|
|
10948
|
-
* ```
|
|
10949
|
-
* @example testPropertyOptionsWithLessThanComparison.ts
|
|
10950
|
-
* ```typescript
|
|
10951
|
-
* import { world, EntityQueryOptions } from '@minecraft/server';
|
|
10952
|
-
*
|
|
10953
|
-
* // No equivalent commands as `..propValue` is inclusive in commands
|
|
10954
|
-
*
|
|
10955
|
-
* function findEntitiesHavingPropertyLessThan(propId: string, propValue: number) {
|
|
10956
|
-
* const queryOption: EntityQueryOptions = {
|
|
10957
|
-
* propertyOptions: [{ propertyId: propId, value: { lessThan: propValue } }]
|
|
10958
|
-
* };
|
|
10959
|
-
*
|
|
10960
|
-
* const overworld = world.getDimension('overworld');
|
|
10961
|
-
* const entities = overworld.getEntities(queryOption);
|
|
10962
|
-
* }
|
|
10963
|
-
* ```
|
|
10964
|
-
* @example testPropertyOptionsWithLessThanOrEqualsComparison.ts
|
|
10965
|
-
* ```typescript
|
|
10966
|
-
* import { world, EntityQueryOptions } from '@minecraft/server';
|
|
10967
|
-
*
|
|
10968
|
-
* // Having this command:
|
|
10969
|
-
*
|
|
10970
|
-
* // execute as @e[has_property={propId=..propValue}]
|
|
10971
|
-
*
|
|
10972
|
-
* // Equivalent scripting code would be:
|
|
10973
|
-
* function findEntitiesHavingPropertyLessThanOrEqualsTo(propId: string, propValue: number) {
|
|
10974
|
-
* const queryOption: EntityQueryOptions = {
|
|
10975
|
-
* propertyOptions: [{ propertyId: propId, value: { lessThanOrEquals: propValue } }]
|
|
10976
|
-
* };
|
|
10977
|
-
*
|
|
10978
|
-
* const overworld = world.getDimension('overworld');
|
|
10979
|
-
* const entities = overworld.getEntities(queryOption);
|
|
10980
|
-
* }
|
|
10981
|
-
* ```
|
|
10982
|
-
* @example testPropertyOptionsWithNotEqualsComparison.ts
|
|
10983
|
-
* ```typescript
|
|
10984
|
-
* import { world, EntityQueryOptions } from '@minecraft/server';
|
|
10985
|
-
*
|
|
10986
|
-
* // Having this command:
|
|
10987
|
-
*
|
|
10988
|
-
* // execute as @e[has_property={propId=!propValue}]
|
|
10989
|
-
*
|
|
10990
|
-
* // Equivalent scripting code would be:
|
|
10991
|
-
* function findEntitiesHavingPropertyNotEqualsTo(propId: string, propValue: boolean | number | string) {
|
|
10992
|
-
* const queryOption: EntityQueryOptions = {
|
|
10993
|
-
* propertyOptions: [{ propertyId: propId, value: { notEquals: propValue } }]
|
|
10994
|
-
* };
|
|
10995
|
-
*
|
|
10996
|
-
* const overworld = world.getDimension('overworld');
|
|
10997
|
-
* const entities = overworld.getEntities(queryOption);
|
|
10998
|
-
* }
|
|
10999
|
-
* ```
|
|
11000
|
-
* @example testPropertyOptionsWithNotHavingAProperty.ts
|
|
11001
|
-
* ```typescript
|
|
11002
|
-
* import { world, EntityQueryOptions } from '@minecraft/server';
|
|
11003
|
-
*
|
|
11004
|
-
* // Having this command:
|
|
11005
|
-
*
|
|
11006
|
-
* // execute as @e[has_property={property=!propId}]
|
|
11007
|
-
*
|
|
11008
|
-
* // Equivalent scripting code would be:
|
|
11009
|
-
* function findEntitiesNotHavingAProperty(propId: string) {
|
|
11010
|
-
* const queryOption: EntityQueryOptions = {
|
|
11011
|
-
* propertyOptions: [{ propertyId: propId, exclude: true }]
|
|
11012
|
-
* };
|
|
11013
|
-
*
|
|
11014
|
-
* const overworld = world.getDimension('overworld');
|
|
11015
|
-
* const entities = overworld.getEntities(queryOption);
|
|
11016
|
-
* }
|
|
11017
|
-
* ```
|
|
11018
|
-
* @example testPropertyOptionsWithRangeComparison.ts
|
|
11019
|
-
* ```typescript
|
|
11020
|
-
* import { world, EntityQueryOptions } from '@minecraft/server';
|
|
11021
|
-
*
|
|
11022
|
-
* // Having this command:
|
|
11023
|
-
*
|
|
11024
|
-
* // execute as @e[has_property={propId=lowerBoundValue..upperBoundValue}]
|
|
11025
|
-
*
|
|
11026
|
-
* // Equivalent scripting code would be:
|
|
11027
|
-
* function findEntitiesHavingPropertyWithinRange(propId: string, lowerBoundValue: number, upperBoundValue: number) {
|
|
11028
|
-
* const queryOption: EntityQueryOptions = {
|
|
11029
|
-
* propertyOptions: [{ propertyId: propId, value: { lowerBound: lowerBoundValue, upperBound: upperBoundValue } }]
|
|
11030
|
-
* };
|
|
11031
|
-
*
|
|
11032
|
-
* const overworld = world.getDimension('overworld');
|
|
11033
|
-
* const entities = overworld.getEntities(queryOption);
|
|
11034
|
-
* }
|
|
11035
|
-
* ```
|
|
11036
10747
|
* @example testSendMessageAllPlayers.ts
|
|
11037
10748
|
* ```typescript
|
|
11038
10749
|
* import { Dimension } from '@minecraft/server';
|
|
@@ -11111,9 +10822,32 @@ export interface EntityHitInformation {
|
|
|
11111
10822
|
* });
|
|
11112
10823
|
* }
|
|
11113
10824
|
* ```
|
|
10825
|
+
* @example checkFeatherNearby.ts
|
|
10826
|
+
* ```typescript
|
|
10827
|
+
* import { DimensionLocation, EntityComponentTypes } from "@minecraft/server";
|
|
10828
|
+
*
|
|
10829
|
+
* // Returns true if a feather item entity is within 'distance' blocks of 'location'.
|
|
10830
|
+
* function isFeatherNear(location: DimensionLocation, distance: number): boolean {
|
|
10831
|
+
* const items = location.dimension.getEntities({
|
|
10832
|
+
* location: location,
|
|
10833
|
+
* maxDistance: 20,
|
|
10834
|
+
* });
|
|
10835
|
+
*
|
|
10836
|
+
* for (const item of items) {
|
|
10837
|
+
* const itemComp = item.getComponent(EntityComponentTypes.Item);
|
|
10838
|
+
*
|
|
10839
|
+
* if (itemComp) {
|
|
10840
|
+
* if (itemComp.itemStack.typeId.endsWith('feather')) {
|
|
10841
|
+
* return true;
|
|
10842
|
+
* }
|
|
10843
|
+
* }
|
|
10844
|
+
* }
|
|
10845
|
+
*
|
|
10846
|
+
* return false;
|
|
10847
|
+
* }
|
|
10848
|
+
* ```
|
|
11114
10849
|
*/
|
|
11115
|
-
|
|
11116
|
-
export interface EntityQueryOptions extends EntityFilter {
|
|
10850
|
+
export interface EntityQueryOptions {
|
|
11117
10851
|
/**
|
|
11118
10852
|
* @remarks
|
|
11119
10853
|
* Limits the number of entities to return, opting for the
|
|
@@ -11123,6 +10857,47 @@ export interface EntityQueryOptions extends EntityFilter {
|
|
|
11123
10857
|
*
|
|
11124
10858
|
*/
|
|
11125
10859
|
closest?: number;
|
|
10860
|
+
/**
|
|
10861
|
+
* @remarks
|
|
10862
|
+
* Excludes entities that match one or more of the specified
|
|
10863
|
+
* families.
|
|
10864
|
+
*
|
|
10865
|
+
*/
|
|
10866
|
+
excludeFamilies?: string[];
|
|
10867
|
+
/**
|
|
10868
|
+
* @remarks
|
|
10869
|
+
* Excludes entities if have a specific gamemode that matches
|
|
10870
|
+
* the specified gamemode.
|
|
10871
|
+
*
|
|
10872
|
+
*/
|
|
10873
|
+
excludeGameModes?: GameMode[];
|
|
10874
|
+
/**
|
|
10875
|
+
* @remarks
|
|
10876
|
+
* Excludes entities that have a name that match one of the
|
|
10877
|
+
* specified values.
|
|
10878
|
+
*
|
|
10879
|
+
*/
|
|
10880
|
+
excludeNames?: string[];
|
|
10881
|
+
/**
|
|
10882
|
+
* @remarks
|
|
10883
|
+
* Excludes entities with a tag that matches one of the
|
|
10884
|
+
* specified values.
|
|
10885
|
+
*
|
|
10886
|
+
*/
|
|
10887
|
+
excludeTags?: string[];
|
|
10888
|
+
/**
|
|
10889
|
+
* @remarks
|
|
10890
|
+
* Excludes entities if they are one of the specified types.
|
|
10891
|
+
*
|
|
10892
|
+
*/
|
|
10893
|
+
excludeTypes?: string[];
|
|
10894
|
+
/**
|
|
10895
|
+
* @remarks
|
|
10896
|
+
* If specified, includes entities that match all of the
|
|
10897
|
+
* specified families.
|
|
10898
|
+
*
|
|
10899
|
+
*/
|
|
10900
|
+
families?: string[];
|
|
11126
10901
|
/**
|
|
11127
10902
|
* @remarks
|
|
11128
10903
|
* Limits the number of entities to return, opting for the
|
|
@@ -11132,6 +10907,13 @@ export interface EntityQueryOptions extends EntityFilter {
|
|
|
11132
10907
|
*
|
|
11133
10908
|
*/
|
|
11134
10909
|
farthest?: number;
|
|
10910
|
+
/**
|
|
10911
|
+
* @remarks
|
|
10912
|
+
* If specified, includes entities with a gamemode that matches
|
|
10913
|
+
* the specified gamemode.
|
|
10914
|
+
*
|
|
10915
|
+
*/
|
|
10916
|
+
gameMode?: GameMode;
|
|
11135
10917
|
/**
|
|
11136
10918
|
* @remarks
|
|
11137
10919
|
* Adds a seed location to the query that is used in
|
|
@@ -11148,6 +10930,27 @@ export interface EntityQueryOptions extends EntityFilter {
|
|
|
11148
10930
|
*
|
|
11149
10931
|
*/
|
|
11150
10932
|
maxDistance?: number;
|
|
10933
|
+
/**
|
|
10934
|
+
* @remarks
|
|
10935
|
+
* If specified, will only include entities that have at most
|
|
10936
|
+
* this horizontal rotation.
|
|
10937
|
+
*
|
|
10938
|
+
*/
|
|
10939
|
+
maxHorizontalRotation?: number;
|
|
10940
|
+
/**
|
|
10941
|
+
* @remarks
|
|
10942
|
+
* If defined, only players that have at most this level are
|
|
10943
|
+
* returned.
|
|
10944
|
+
*
|
|
10945
|
+
*/
|
|
10946
|
+
maxLevel?: number;
|
|
10947
|
+
/**
|
|
10948
|
+
* @remarks
|
|
10949
|
+
* If specified, only entities that have at most this vertical
|
|
10950
|
+
* rotation are returned.
|
|
10951
|
+
*
|
|
10952
|
+
*/
|
|
10953
|
+
maxVerticalRotation?: number;
|
|
11151
10954
|
/**
|
|
11152
10955
|
* @remarks
|
|
11153
10956
|
* If specified, includes entities that are least this distance
|
|
@@ -11155,6 +10958,52 @@ export interface EntityQueryOptions extends EntityFilter {
|
|
|
11155
10958
|
*
|
|
11156
10959
|
*/
|
|
11157
10960
|
minDistance?: number;
|
|
10961
|
+
/**
|
|
10962
|
+
* @remarks
|
|
10963
|
+
* If specified, will only include entities that have at a
|
|
10964
|
+
* minimum this horizontal rotation.
|
|
10965
|
+
*
|
|
10966
|
+
*/
|
|
10967
|
+
minHorizontalRotation?: number;
|
|
10968
|
+
/**
|
|
10969
|
+
* @remarks
|
|
10970
|
+
* If defined, only players that have at least this level are
|
|
10971
|
+
* returned.
|
|
10972
|
+
*
|
|
10973
|
+
*/
|
|
10974
|
+
minLevel?: number;
|
|
10975
|
+
/**
|
|
10976
|
+
* @remarks
|
|
10977
|
+
* If specified, will only include entities that have at least
|
|
10978
|
+
* this vertical rotation.
|
|
10979
|
+
*
|
|
10980
|
+
*/
|
|
10981
|
+
minVerticalRotation?: number;
|
|
10982
|
+
/**
|
|
10983
|
+
* @remarks
|
|
10984
|
+
* Includes entities with the specified name.
|
|
10985
|
+
*
|
|
10986
|
+
*/
|
|
10987
|
+
name?: string;
|
|
10988
|
+
/**
|
|
10989
|
+
* @remarks
|
|
10990
|
+
* Gets/sets a collection of EntityQueryScoreOptions objects
|
|
10991
|
+
* with filters for specific scoreboard objectives.
|
|
10992
|
+
*
|
|
10993
|
+
*/
|
|
10994
|
+
scoreOptions?: EntityQueryScoreOptions[];
|
|
10995
|
+
/**
|
|
10996
|
+
* @remarks
|
|
10997
|
+
* Includes entities that match all of the specified tags.
|
|
10998
|
+
*
|
|
10999
|
+
*/
|
|
11000
|
+
tags?: string[];
|
|
11001
|
+
/**
|
|
11002
|
+
* @remarks
|
|
11003
|
+
* If defined, entities that match this type are included.
|
|
11004
|
+
*
|
|
11005
|
+
*/
|
|
11006
|
+
type?: string;
|
|
11158
11007
|
}
|
|
11159
11008
|
|
|
11160
11009
|
/**
|
|
@@ -11212,8 +11061,7 @@ export interface EntityRaycastHit {
|
|
|
11212
11061
|
/**
|
|
11213
11062
|
* Contains additional options for an entity raycast operation.
|
|
11214
11063
|
*/
|
|
11215
|
-
|
|
11216
|
-
export interface EntityRaycastOptions extends EntityFilter {
|
|
11064
|
+
export interface EntityRaycastOptions {
|
|
11217
11065
|
/**
|
|
11218
11066
|
* @remarks
|
|
11219
11067
|
* Maximum distance, in blocks, to process the raycast.
|
|
@@ -11359,9 +11207,6 @@ export interface PlayerSoundOptions {
|
|
|
11359
11207
|
volume?: number;
|
|
11360
11208
|
}
|
|
11361
11209
|
|
|
11362
|
-
/**
|
|
11363
|
-
* @beta
|
|
11364
|
-
*/
|
|
11365
11210
|
export interface ProjectileShootOptions {
|
|
11366
11211
|
uncertainty?: number;
|
|
11367
11212
|
}
|
|
@@ -11578,7 +11423,6 @@ export interface ScriptEventMessageFilterOptions {
|
|
|
11578
11423
|
}
|
|
11579
11424
|
|
|
11580
11425
|
/**
|
|
11581
|
-
* @beta
|
|
11582
11426
|
* Provides additional options for {@link
|
|
11583
11427
|
* StructureManager.createFromWorld}
|
|
11584
11428
|
*/
|
|
@@ -11607,7 +11451,6 @@ export interface StructureCreateOptions {
|
|
|
11607
11451
|
}
|
|
11608
11452
|
|
|
11609
11453
|
/**
|
|
11610
|
-
* @beta
|
|
11611
11454
|
* Provides additional options for {@link
|
|
11612
11455
|
* StructureManager.place}
|
|
11613
11456
|
*/
|
|
@@ -11851,7 +11694,6 @@ export class InvalidContainerSlotError extends Error {
|
|
|
11851
11694
|
}
|
|
11852
11695
|
|
|
11853
11696
|
/**
|
|
11854
|
-
* @beta
|
|
11855
11697
|
* Thrown when a Structure is invalid. A structure becomes
|
|
11856
11698
|
* invalid when it is deleted.
|
|
11857
11699
|
*/
|