@minecraft/server 1.2.0-rc.1.20.0-preview.22 → 1.2.0-rc.1.20.0-preview.24
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 +794 -7
- package/package.json +1 -1
package/index.d.ts
CHANGED
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
* ```json
|
|
17
17
|
* {
|
|
18
18
|
* "module_name": "@minecraft/server",
|
|
19
|
-
* "version": "1.
|
|
19
|
+
* "version": "1.4.0-internal.1.20.0-preview.24"
|
|
20
20
|
* }
|
|
21
21
|
* ```
|
|
22
22
|
*
|
|
@@ -184,6 +184,13 @@ export class BlockInventoryComponent {
|
|
|
184
184
|
* @throws This property can throw when used.
|
|
185
185
|
*/
|
|
186
186
|
readonly container: Container;
|
|
187
|
+
/**
|
|
188
|
+
* @remarks
|
|
189
|
+
* Identifier of this component. Should always be
|
|
190
|
+
* minecraft:inventory.
|
|
191
|
+
*
|
|
192
|
+
*/
|
|
193
|
+
static readonly componentId = 'minecraft:inventory';
|
|
187
194
|
}
|
|
188
195
|
|
|
189
196
|
/**
|
|
@@ -233,6 +240,20 @@ export class CommandResult {
|
|
|
233
240
|
readonly successCount: number;
|
|
234
241
|
}
|
|
235
242
|
|
|
243
|
+
/**
|
|
244
|
+
* @beta
|
|
245
|
+
* Base class for downstream Component implementations.
|
|
246
|
+
*/
|
|
247
|
+
export class Component {
|
|
248
|
+
protected constructor();
|
|
249
|
+
/**
|
|
250
|
+
* @remarks
|
|
251
|
+
* Identifier of the component.
|
|
252
|
+
*
|
|
253
|
+
*/
|
|
254
|
+
readonly typeId: string;
|
|
255
|
+
}
|
|
256
|
+
|
|
236
257
|
/**
|
|
237
258
|
* @beta
|
|
238
259
|
* Represents a container that can hold sets of items. Used
|
|
@@ -420,8 +441,7 @@ export class Dimension {
|
|
|
420
441
|
/**
|
|
421
442
|
* @beta
|
|
422
443
|
* @remarks
|
|
423
|
-
* Returns a block instance at the given location.
|
|
424
|
-
* was introduced as of version 1.17.10.21.
|
|
444
|
+
* Returns a block instance at the given location.
|
|
425
445
|
*
|
|
426
446
|
* @param location
|
|
427
447
|
* The location at which to return a block.
|
|
@@ -572,6 +592,9 @@ export class Entity {
|
|
|
572
592
|
*
|
|
573
593
|
* @param tag
|
|
574
594
|
* Content of the tag to add.
|
|
595
|
+
* @returns
|
|
596
|
+
* Returns true if the tag was added successfully. This can
|
|
597
|
+
* fail if the tag already exists on the entity.
|
|
575
598
|
* @throws This function can throw errors.
|
|
576
599
|
*/
|
|
577
600
|
addTag(tag: string): boolean;
|
|
@@ -588,6 +611,10 @@ export class Entity {
|
|
|
588
611
|
* Additional options about the source of damage, which may add
|
|
589
612
|
* additional effects or spur additional behaviors on this
|
|
590
613
|
* entity.
|
|
614
|
+
* @returns
|
|
615
|
+
* Whether the entity takes any damage. This can return false
|
|
616
|
+
* if the entity is invulnerable or if the damage applied is
|
|
617
|
+
* less than or equal to 0.
|
|
591
618
|
* @throws This function can throw errors.
|
|
592
619
|
*/
|
|
593
620
|
applyDamage(amount: number, options?: EntityApplyDamageByProjectileOptions | EntityApplyDamageOptions): boolean;
|
|
@@ -634,12 +661,42 @@ export class Entity {
|
|
|
634
661
|
* @throws This function can throw errors.
|
|
635
662
|
*/
|
|
636
663
|
clearVelocity(): void;
|
|
664
|
+
/**
|
|
665
|
+
* @beta
|
|
666
|
+
* @remarks
|
|
667
|
+
* Gets a component (that represents additional capabilities)
|
|
668
|
+
* for an entity.
|
|
669
|
+
*
|
|
670
|
+
* @param componentId
|
|
671
|
+
* The identifier of the component (e.g., 'minecraft:rideable')
|
|
672
|
+
* to retrieve. If no namespace prefix is specified,
|
|
673
|
+
* 'minecraft:' is assumed. If the component is not present on
|
|
674
|
+
* the entity, undefined is returned.
|
|
675
|
+
* @returns
|
|
676
|
+
* Returns the component if it exists on the entity, otherwise
|
|
677
|
+
* undefined.
|
|
678
|
+
*/
|
|
679
|
+
getComponent(componentId: string): EntityComponent | undefined;
|
|
680
|
+
/**
|
|
681
|
+
* @beta
|
|
682
|
+
* @remarks
|
|
683
|
+
* Returns all components that are both present on this entity
|
|
684
|
+
* and supported by the API.
|
|
685
|
+
*
|
|
686
|
+
* @returns
|
|
687
|
+
* Returns all components that are both present on this entity
|
|
688
|
+
* and supported by the API.
|
|
689
|
+
*/
|
|
690
|
+
getComponents(): EntityComponent[];
|
|
637
691
|
/**
|
|
638
692
|
* @beta
|
|
639
693
|
* @remarks
|
|
640
694
|
* Returns the current location of the head component of this
|
|
641
695
|
* entity.
|
|
642
696
|
*
|
|
697
|
+
* @returns
|
|
698
|
+
* Returns the current location of the head component of this
|
|
699
|
+
* entity.
|
|
643
700
|
* @throws This function can throw errors.
|
|
644
701
|
*/
|
|
645
702
|
getHeadLocation(): Vector3;
|
|
@@ -648,6 +705,8 @@ export class Entity {
|
|
|
648
705
|
* @remarks
|
|
649
706
|
* Returns all tags associated with an entity.
|
|
650
707
|
*
|
|
708
|
+
* @returns
|
|
709
|
+
* Returns the current rotation component of this entity.
|
|
651
710
|
* @throws This function can throw errors.
|
|
652
711
|
*/
|
|
653
712
|
getTags(): string[];
|
|
@@ -656,6 +715,8 @@ export class Entity {
|
|
|
656
715
|
* @remarks
|
|
657
716
|
* Returns the current velocity vector of the entity.
|
|
658
717
|
*
|
|
718
|
+
* @returns
|
|
719
|
+
* Returns the current velocity vector of the entity.
|
|
659
720
|
* @throws This function can throw errors.
|
|
660
721
|
*/
|
|
661
722
|
getVelocity(): Vector3;
|
|
@@ -664,16 +725,35 @@ export class Entity {
|
|
|
664
725
|
* @remarks
|
|
665
726
|
* Returns the current view direction of the entity.
|
|
666
727
|
*
|
|
728
|
+
* @returns
|
|
729
|
+
* Returns the current view direction of the entity.
|
|
667
730
|
* @throws This function can throw errors.
|
|
668
731
|
*/
|
|
669
732
|
getViewDirection(): Vector3;
|
|
670
733
|
/**
|
|
671
734
|
* @beta
|
|
672
735
|
* @remarks
|
|
673
|
-
*
|
|
736
|
+
* Returns true if the specified component is present on this
|
|
737
|
+
* entity.
|
|
738
|
+
*
|
|
739
|
+
* @param componentId
|
|
740
|
+
* The identifier of the component (e.g., 'minecraft:rideable')
|
|
741
|
+
* to retrieve. If no namespace prefix is specified,
|
|
742
|
+
* 'minecraft:' is assumed.
|
|
743
|
+
* @returns
|
|
744
|
+
* Returns true if the specified component is present on this
|
|
745
|
+
* entity.
|
|
746
|
+
*/
|
|
747
|
+
hasComponent(componentId: string): boolean;
|
|
748
|
+
/**
|
|
749
|
+
* @beta
|
|
750
|
+
* @remarks
|
|
751
|
+
* Returns whether an entity has a particular tag.
|
|
674
752
|
*
|
|
675
753
|
* @param tag
|
|
676
754
|
* Identifier of the tag to test for.
|
|
755
|
+
* @returns
|
|
756
|
+
* Returns whether an entity has a particular tag.
|
|
677
757
|
* @throws This function can throw errors.
|
|
678
758
|
*/
|
|
679
759
|
hasTag(tag: string): boolean;
|
|
@@ -699,14 +779,24 @@ export class Entity {
|
|
|
699
779
|
*
|
|
700
780
|
* @param tag
|
|
701
781
|
* Content of the tag to remove.
|
|
782
|
+
* @returns
|
|
783
|
+
* Returns whether the tag existed on the entity.
|
|
702
784
|
* @throws This function can throw errors.
|
|
703
785
|
*/
|
|
704
786
|
removeTag(tag: string): boolean;
|
|
705
787
|
/**
|
|
706
788
|
* @beta
|
|
707
789
|
* @remarks
|
|
790
|
+
* Runs a synchronous command on the entity.
|
|
791
|
+
*
|
|
708
792
|
* This function can't be called in read-only mode.
|
|
709
793
|
*
|
|
794
|
+
* @param commandString
|
|
795
|
+
* The command string. Note: This should not include a leading
|
|
796
|
+
* forward slash.
|
|
797
|
+
* @returns
|
|
798
|
+
* A command result containing whether the command was
|
|
799
|
+
* successful.
|
|
710
800
|
* @throws This function can throw errors.
|
|
711
801
|
*/
|
|
712
802
|
runCommand(commandString: string): CommandResult;
|
|
@@ -727,11 +817,195 @@ export class Entity {
|
|
|
727
817
|
runCommandAsync(commandString: string): Promise<CommandResult>;
|
|
728
818
|
}
|
|
729
819
|
|
|
820
|
+
/**
|
|
821
|
+
* @beta
|
|
822
|
+
* Base class for a family of entity movement events.
|
|
823
|
+
*/
|
|
824
|
+
export class EntityBaseMovementComponent extends EntityComponent {
|
|
825
|
+
protected constructor();
|
|
826
|
+
readonly maxTurn: number;
|
|
827
|
+
}
|
|
828
|
+
|
|
829
|
+
/**
|
|
830
|
+
* @beta
|
|
831
|
+
* When added, this component signifies that the entity can
|
|
832
|
+
* climb up ladders.
|
|
833
|
+
*/
|
|
834
|
+
export class EntityCanClimbComponent extends EntityComponent {
|
|
835
|
+
protected constructor();
|
|
836
|
+
/**
|
|
837
|
+
* @remarks
|
|
838
|
+
* Identifier of this component. Should always be
|
|
839
|
+
* minecraft:can_climb.
|
|
840
|
+
*
|
|
841
|
+
*/
|
|
842
|
+
static readonly componentId = 'minecraft:can_climb';
|
|
843
|
+
}
|
|
844
|
+
|
|
845
|
+
/**
|
|
846
|
+
* @beta
|
|
847
|
+
* When added, this component signifies that the entity can
|
|
848
|
+
* fly, and the pathfinder won't be restricted to paths where a
|
|
849
|
+
* solid block is required underneath it.
|
|
850
|
+
*/
|
|
851
|
+
export class EntityCanFlyComponent extends EntityComponent {
|
|
852
|
+
protected constructor();
|
|
853
|
+
/**
|
|
854
|
+
* @remarks
|
|
855
|
+
* Identifier of this component. Should always be
|
|
856
|
+
* minecraft:can_fly.
|
|
857
|
+
*
|
|
858
|
+
*/
|
|
859
|
+
static readonly componentId = 'minecraft:can_fly';
|
|
860
|
+
}
|
|
861
|
+
|
|
862
|
+
/**
|
|
863
|
+
* @beta
|
|
864
|
+
* When added, this component signifies that the entity can
|
|
865
|
+
* power jump like the horse does within Minecraft.
|
|
866
|
+
*/
|
|
867
|
+
export class EntityCanPowerJumpComponent extends EntityComponent {
|
|
868
|
+
protected constructor();
|
|
869
|
+
/**
|
|
870
|
+
* @remarks
|
|
871
|
+
* Identifier of this component. Should always be
|
|
872
|
+
* minecraft:can_power_jump.
|
|
873
|
+
*
|
|
874
|
+
*/
|
|
875
|
+
static readonly componentId = 'minecraft:can_power_jump';
|
|
876
|
+
}
|
|
877
|
+
|
|
878
|
+
/**
|
|
879
|
+
* @beta
|
|
880
|
+
* Defines the entity's color. Only works on certain entities
|
|
881
|
+
* that have predefined color values (sheep, llama, shulker).
|
|
882
|
+
*/
|
|
883
|
+
export class EntityColorComponent extends EntityComponent {
|
|
884
|
+
protected constructor();
|
|
885
|
+
/**
|
|
886
|
+
* @remarks
|
|
887
|
+
* This property can't be edited in read-only mode.
|
|
888
|
+
*
|
|
889
|
+
*/
|
|
890
|
+
value: number;
|
|
891
|
+
/**
|
|
892
|
+
* @remarks
|
|
893
|
+
* Identifier of this component. Should always be
|
|
894
|
+
* minecraft:color.
|
|
895
|
+
*
|
|
896
|
+
*/
|
|
897
|
+
static readonly componentId = 'minecraft:color';
|
|
898
|
+
}
|
|
899
|
+
|
|
900
|
+
/**
|
|
901
|
+
* @beta
|
|
902
|
+
* Base class for downstream entity components.
|
|
903
|
+
*/
|
|
904
|
+
export class EntityComponent extends Component {
|
|
905
|
+
protected constructor();
|
|
906
|
+
}
|
|
907
|
+
|
|
908
|
+
/**
|
|
909
|
+
* @beta
|
|
910
|
+
* When added, this component signifies that this entity
|
|
911
|
+
* doesn't take damage from fire.
|
|
912
|
+
*/
|
|
913
|
+
export class EntityFireImmuneComponent extends EntityComponent {
|
|
914
|
+
protected constructor();
|
|
915
|
+
/**
|
|
916
|
+
* @remarks
|
|
917
|
+
* Identifier of this component. Should always be
|
|
918
|
+
* minecraft:fire_immune.
|
|
919
|
+
*
|
|
920
|
+
*/
|
|
921
|
+
static readonly componentId = 'minecraft:fire_immune';
|
|
922
|
+
}
|
|
923
|
+
|
|
924
|
+
/**
|
|
925
|
+
* @beta
|
|
926
|
+
* When added, this component signifies that this entity can
|
|
927
|
+
* float in liquid blocks.
|
|
928
|
+
*/
|
|
929
|
+
export class EntityFloatsInLiquidComponent extends EntityComponent {
|
|
930
|
+
protected constructor();
|
|
931
|
+
/**
|
|
932
|
+
* @remarks
|
|
933
|
+
* Identifier of this component. Should always be
|
|
934
|
+
* minecraft:floats_in_liquid.
|
|
935
|
+
*
|
|
936
|
+
*/
|
|
937
|
+
static readonly componentId = 'minecraft:floats_in_liquid';
|
|
938
|
+
}
|
|
939
|
+
|
|
940
|
+
/**
|
|
941
|
+
* @beta
|
|
942
|
+
* Represents the flying speed of an entity.
|
|
943
|
+
*/
|
|
944
|
+
export class EntityFlyingSpeedComponent extends EntityComponent {
|
|
945
|
+
protected constructor();
|
|
946
|
+
/**
|
|
947
|
+
* @remarks
|
|
948
|
+
* This property can't be edited in read-only mode.
|
|
949
|
+
*
|
|
950
|
+
*/
|
|
951
|
+
value: number;
|
|
952
|
+
/**
|
|
953
|
+
* @remarks
|
|
954
|
+
* Identifier of this component. Should always be
|
|
955
|
+
* minecraft:flying_speed.
|
|
956
|
+
*
|
|
957
|
+
*/
|
|
958
|
+
static readonly componentId = 'minecraft:flying_speed';
|
|
959
|
+
}
|
|
960
|
+
|
|
961
|
+
/**
|
|
962
|
+
* @beta
|
|
963
|
+
* Defines how much friction affects this entity.
|
|
964
|
+
*/
|
|
965
|
+
export class EntityFrictionModifierComponent extends EntityComponent {
|
|
966
|
+
protected constructor();
|
|
967
|
+
/**
|
|
968
|
+
* @remarks
|
|
969
|
+
* This property can't be edited in read-only mode.
|
|
970
|
+
*
|
|
971
|
+
*/
|
|
972
|
+
value: number;
|
|
973
|
+
/**
|
|
974
|
+
* @remarks
|
|
975
|
+
* Identifier of this component. Should always be
|
|
976
|
+
* minecraft:friction_modifier.
|
|
977
|
+
*
|
|
978
|
+
*/
|
|
979
|
+
static readonly componentId = 'minecraft:friction_modifier';
|
|
980
|
+
}
|
|
981
|
+
|
|
982
|
+
/**
|
|
983
|
+
* @beta
|
|
984
|
+
* Sets the offset from the ground that the entity is actually
|
|
985
|
+
* at.
|
|
986
|
+
*/
|
|
987
|
+
export class EntityGroundOffsetComponent extends EntityComponent {
|
|
988
|
+
protected constructor();
|
|
989
|
+
/**
|
|
990
|
+
* @remarks
|
|
991
|
+
* This property can't be edited in read-only mode.
|
|
992
|
+
*
|
|
993
|
+
*/
|
|
994
|
+
value: number;
|
|
995
|
+
/**
|
|
996
|
+
* @remarks
|
|
997
|
+
* Identifier of this component. Should always be
|
|
998
|
+
* minecraft:ground_offset.
|
|
999
|
+
*
|
|
1000
|
+
*/
|
|
1001
|
+
static readonly componentId = 'minecraft:ground_offset';
|
|
1002
|
+
}
|
|
1003
|
+
|
|
730
1004
|
/**
|
|
731
1005
|
* @beta
|
|
732
1006
|
* Defines this entity's inventory properties.
|
|
733
1007
|
*/
|
|
734
|
-
export class EntityInventoryComponent {
|
|
1008
|
+
export class EntityInventoryComponent extends EntityComponent {
|
|
735
1009
|
protected constructor();
|
|
736
1010
|
/**
|
|
737
1011
|
* @remarks
|
|
@@ -785,6 +1059,221 @@ export class EntityInventoryComponent {
|
|
|
785
1059
|
* @throws This property can throw when used.
|
|
786
1060
|
*/
|
|
787
1061
|
readonly restrictToOwner: boolean;
|
|
1062
|
+
/**
|
|
1063
|
+
* @remarks
|
|
1064
|
+
* Identifier of this component. Should always be
|
|
1065
|
+
* minecraft:inventory.
|
|
1066
|
+
*
|
|
1067
|
+
*/
|
|
1068
|
+
static readonly componentId = 'minecraft:inventory';
|
|
1069
|
+
}
|
|
1070
|
+
|
|
1071
|
+
/**
|
|
1072
|
+
* @beta
|
|
1073
|
+
* When added, this component signifies that this entity is a
|
|
1074
|
+
* baby.
|
|
1075
|
+
*/
|
|
1076
|
+
export class EntityIsBabyComponent extends EntityComponent {
|
|
1077
|
+
protected constructor();
|
|
1078
|
+
/**
|
|
1079
|
+
* @remarks
|
|
1080
|
+
* Identifier of this component. Should always be
|
|
1081
|
+
* minecraft:is_baby.
|
|
1082
|
+
*
|
|
1083
|
+
*/
|
|
1084
|
+
static readonly componentId = 'minecraft:is_baby';
|
|
1085
|
+
}
|
|
1086
|
+
|
|
1087
|
+
/**
|
|
1088
|
+
* @beta
|
|
1089
|
+
* When added, this component signifies that this entity is
|
|
1090
|
+
* charged.
|
|
1091
|
+
*/
|
|
1092
|
+
export class EntityIsChargedComponent extends EntityComponent {
|
|
1093
|
+
protected constructor();
|
|
1094
|
+
/**
|
|
1095
|
+
* @remarks
|
|
1096
|
+
* Identifier of this component. Should always be
|
|
1097
|
+
* minecraft:is_charged.
|
|
1098
|
+
*
|
|
1099
|
+
*/
|
|
1100
|
+
static readonly componentId = 'minecraft:is_charged';
|
|
1101
|
+
}
|
|
1102
|
+
|
|
1103
|
+
/**
|
|
1104
|
+
* @beta
|
|
1105
|
+
* When added, this component signifies that this entity is
|
|
1106
|
+
* currently carrying a chest.
|
|
1107
|
+
*/
|
|
1108
|
+
export class EntityIsChestedComponent extends EntityComponent {
|
|
1109
|
+
protected constructor();
|
|
1110
|
+
/**
|
|
1111
|
+
* @remarks
|
|
1112
|
+
* Identifier of this component. Should always be
|
|
1113
|
+
* minecraft:is_chested.
|
|
1114
|
+
*
|
|
1115
|
+
*/
|
|
1116
|
+
static readonly componentId = 'minecraft:is_chested';
|
|
1117
|
+
}
|
|
1118
|
+
|
|
1119
|
+
/**
|
|
1120
|
+
* @beta
|
|
1121
|
+
* When added, this component signifies that dyes can be used
|
|
1122
|
+
* on this entity to change its color.
|
|
1123
|
+
*/
|
|
1124
|
+
export class EntityIsDyeableComponent extends EntityComponent {
|
|
1125
|
+
protected constructor();
|
|
1126
|
+
/**
|
|
1127
|
+
* @remarks
|
|
1128
|
+
* Identifier of this component. Should always be
|
|
1129
|
+
* minecraft:is_dyeable.
|
|
1130
|
+
*
|
|
1131
|
+
*/
|
|
1132
|
+
static readonly componentId = 'minecraft:is_dyeable';
|
|
1133
|
+
}
|
|
1134
|
+
|
|
1135
|
+
/**
|
|
1136
|
+
* @beta
|
|
1137
|
+
* When added, this component signifies that this entity can
|
|
1138
|
+
* hide from hostile mobs while invisible.
|
|
1139
|
+
*/
|
|
1140
|
+
export class EntityIsHiddenWhenInvisibleComponent extends EntityComponent {
|
|
1141
|
+
protected constructor();
|
|
1142
|
+
/**
|
|
1143
|
+
* @remarks
|
|
1144
|
+
* Identifier of this component. Should always be
|
|
1145
|
+
* minecraft:is_hidden_when_invisible.
|
|
1146
|
+
*
|
|
1147
|
+
*/
|
|
1148
|
+
static readonly componentId = 'minecraft:is_hidden_when_invisible';
|
|
1149
|
+
}
|
|
1150
|
+
|
|
1151
|
+
/**
|
|
1152
|
+
* @beta
|
|
1153
|
+
* When added, this component signifies that this entity this
|
|
1154
|
+
* currently on fire.
|
|
1155
|
+
*/
|
|
1156
|
+
export class EntityIsIgnitedComponent extends EntityComponent {
|
|
1157
|
+
protected constructor();
|
|
1158
|
+
/**
|
|
1159
|
+
* @remarks
|
|
1160
|
+
* Identifier of this component. Should always be
|
|
1161
|
+
* minecraft:is_ignited.
|
|
1162
|
+
*
|
|
1163
|
+
*/
|
|
1164
|
+
static readonly componentId = 'minecraft:is_ignited';
|
|
1165
|
+
}
|
|
1166
|
+
|
|
1167
|
+
/**
|
|
1168
|
+
* @beta
|
|
1169
|
+
* When added, this component signifies that this entity is an
|
|
1170
|
+
* illager captain.
|
|
1171
|
+
*/
|
|
1172
|
+
export class EntityIsIllagerCaptainComponent extends EntityComponent {
|
|
1173
|
+
protected constructor();
|
|
1174
|
+
/**
|
|
1175
|
+
* @remarks
|
|
1176
|
+
* Identifier of this component. Should always be
|
|
1177
|
+
* minecraft:is_illager_captain.
|
|
1178
|
+
*
|
|
1179
|
+
*/
|
|
1180
|
+
static readonly componentId = 'minecraft:is_illager_captain';
|
|
1181
|
+
}
|
|
1182
|
+
|
|
1183
|
+
/**
|
|
1184
|
+
* @beta
|
|
1185
|
+
* When added, this component signifies that this entity is
|
|
1186
|
+
* currently saddled.
|
|
1187
|
+
*/
|
|
1188
|
+
export class EntityIsSaddledComponent extends EntityComponent {
|
|
1189
|
+
protected constructor();
|
|
1190
|
+
/**
|
|
1191
|
+
* @remarks
|
|
1192
|
+
* Identifier of this component. Should always be
|
|
1193
|
+
* minecraft:is_saddled.
|
|
1194
|
+
*
|
|
1195
|
+
*/
|
|
1196
|
+
static readonly componentId = 'minecraft:is_saddled';
|
|
1197
|
+
}
|
|
1198
|
+
|
|
1199
|
+
/**
|
|
1200
|
+
* @beta
|
|
1201
|
+
* When added, this component signifies that this entity is
|
|
1202
|
+
* currently shaking.
|
|
1203
|
+
*/
|
|
1204
|
+
export class EntityIsShakingComponent extends EntityComponent {
|
|
1205
|
+
protected constructor();
|
|
1206
|
+
/**
|
|
1207
|
+
* @remarks
|
|
1208
|
+
* Identifier of this component. Should always be
|
|
1209
|
+
* minecraft:is_shaking.
|
|
1210
|
+
*
|
|
1211
|
+
*/
|
|
1212
|
+
static readonly componentId = 'minecraft:is_shaking';
|
|
1213
|
+
}
|
|
1214
|
+
|
|
1215
|
+
/**
|
|
1216
|
+
* @beta
|
|
1217
|
+
* When added, this component signifies that this entity is
|
|
1218
|
+
* currently sheared.
|
|
1219
|
+
*/
|
|
1220
|
+
export class EntityIsShearedComponent extends EntityComponent {
|
|
1221
|
+
protected constructor();
|
|
1222
|
+
/**
|
|
1223
|
+
* @remarks
|
|
1224
|
+
* Identifier of this component. Should always be
|
|
1225
|
+
* minecraft:is_sheared.
|
|
1226
|
+
*
|
|
1227
|
+
*/
|
|
1228
|
+
static readonly componentId = 'minecraft:is_sheared';
|
|
1229
|
+
}
|
|
1230
|
+
|
|
1231
|
+
/**
|
|
1232
|
+
* @beta
|
|
1233
|
+
* When added, this component signifies that this entity can be
|
|
1234
|
+
* stacked.
|
|
1235
|
+
*/
|
|
1236
|
+
export class EntityIsStackableComponent extends EntityComponent {
|
|
1237
|
+
protected constructor();
|
|
1238
|
+
/**
|
|
1239
|
+
* @remarks
|
|
1240
|
+
* Identifier of this component. Should always be
|
|
1241
|
+
* minecraft:is_stackable.
|
|
1242
|
+
*
|
|
1243
|
+
*/
|
|
1244
|
+
static readonly componentId = 'minecraft:is_stackable';
|
|
1245
|
+
}
|
|
1246
|
+
|
|
1247
|
+
/**
|
|
1248
|
+
* @beta
|
|
1249
|
+
* When added, this component signifies that this entity is
|
|
1250
|
+
* currently stunned.
|
|
1251
|
+
*/
|
|
1252
|
+
export class EntityIsStunnedComponent extends EntityComponent {
|
|
1253
|
+
protected constructor();
|
|
1254
|
+
/**
|
|
1255
|
+
* @remarks
|
|
1256
|
+
* Identifier of this component. Should always be
|
|
1257
|
+
* minecraft:is_stunned.
|
|
1258
|
+
*
|
|
1259
|
+
*/
|
|
1260
|
+
static readonly componentId = 'minecraft:is_stunned';
|
|
1261
|
+
}
|
|
1262
|
+
|
|
1263
|
+
/**
|
|
1264
|
+
* @beta
|
|
1265
|
+
* When added, this component signifies that this entity is
|
|
1266
|
+
* currently tamed.
|
|
1267
|
+
*/
|
|
1268
|
+
export class EntityIsTamedComponent extends EntityComponent {
|
|
1269
|
+
protected constructor();
|
|
1270
|
+
/**
|
|
1271
|
+
* @remarks
|
|
1272
|
+
* Identifier of this component. Should always be
|
|
1273
|
+
* minecraft:is_tamed.
|
|
1274
|
+
*
|
|
1275
|
+
*/
|
|
1276
|
+
static readonly componentId = 'minecraft:is_tamed';
|
|
788
1277
|
}
|
|
789
1278
|
|
|
790
1279
|
/**
|
|
@@ -794,7 +1283,7 @@ export class EntityInventoryComponent {
|
|
|
794
1283
|
* retrieve the actual item stack contents via the itemStack
|
|
795
1284
|
* property.
|
|
796
1285
|
*/
|
|
797
|
-
export class EntityItemComponent {
|
|
1286
|
+
export class EntityItemComponent extends EntityComponent {
|
|
798
1287
|
protected constructor();
|
|
799
1288
|
/**
|
|
800
1289
|
* @remarks
|
|
@@ -803,13 +1292,247 @@ export class EntityItemComponent {
|
|
|
803
1292
|
* @throws This property can throw when used.
|
|
804
1293
|
*/
|
|
805
1294
|
readonly itemStack: ItemStack;
|
|
1295
|
+
/**
|
|
1296
|
+
* @remarks
|
|
1297
|
+
* Identifier of this component.
|
|
1298
|
+
*
|
|
1299
|
+
*/
|
|
1300
|
+
static readonly componentId = 'minecraft:item';
|
|
1301
|
+
}
|
|
1302
|
+
|
|
1303
|
+
/**
|
|
1304
|
+
* @beta
|
|
1305
|
+
* Additional variant value. Can be used to further
|
|
1306
|
+
* differentiate variants.
|
|
1307
|
+
*/
|
|
1308
|
+
export class EntityMarkVariantComponent extends EntityComponent {
|
|
1309
|
+
protected constructor();
|
|
1310
|
+
/**
|
|
1311
|
+
* @remarks
|
|
1312
|
+
* This property can't be edited in read-only mode.
|
|
1313
|
+
*
|
|
1314
|
+
*/
|
|
1315
|
+
value: number;
|
|
1316
|
+
/**
|
|
1317
|
+
* @remarks
|
|
1318
|
+
* Identifier of this component. Should always be
|
|
1319
|
+
* minecraft:mark_variant.
|
|
1320
|
+
*
|
|
1321
|
+
*/
|
|
1322
|
+
static readonly componentId = 'minecraft:mark_variant';
|
|
1323
|
+
}
|
|
1324
|
+
|
|
1325
|
+
/**
|
|
1326
|
+
* @beta
|
|
1327
|
+
* When added, this movement control allows the mob to swim in
|
|
1328
|
+
* water and walk on land.
|
|
1329
|
+
*/
|
|
1330
|
+
export class EntityMovementAmphibiousComponent extends EntityBaseMovementComponent {
|
|
1331
|
+
protected constructor();
|
|
1332
|
+
/**
|
|
1333
|
+
* @remarks
|
|
1334
|
+
* Identifier of this component. Should always be
|
|
1335
|
+
* minecraft:movement.amphibious.
|
|
1336
|
+
*
|
|
1337
|
+
*/
|
|
1338
|
+
static readonly componentId = 'minecraft:movement.amphibious';
|
|
1339
|
+
}
|
|
1340
|
+
|
|
1341
|
+
/**
|
|
1342
|
+
* @beta
|
|
1343
|
+
* This component accents the movement of an entity.
|
|
1344
|
+
*/
|
|
1345
|
+
export class EntityMovementBasicComponent extends EntityBaseMovementComponent {
|
|
1346
|
+
protected constructor();
|
|
1347
|
+
/**
|
|
1348
|
+
* @remarks
|
|
1349
|
+
* Identifier of this component. Should always be
|
|
1350
|
+
* minecraft:movement.basic.
|
|
1351
|
+
*
|
|
1352
|
+
*/
|
|
1353
|
+
static readonly componentId = 'minecraft:movement.basic';
|
|
1354
|
+
}
|
|
1355
|
+
|
|
1356
|
+
/**
|
|
1357
|
+
* @beta
|
|
1358
|
+
* When added, this move control causes the mob to fly.
|
|
1359
|
+
*/
|
|
1360
|
+
export class EntityMovementFlyComponent extends EntityBaseMovementComponent {
|
|
1361
|
+
protected constructor();
|
|
1362
|
+
/**
|
|
1363
|
+
* @remarks
|
|
1364
|
+
* Identifier of this component. Should always be
|
|
1365
|
+
* minecraft:movement.fly.
|
|
1366
|
+
*
|
|
1367
|
+
*/
|
|
1368
|
+
static readonly componentId = 'minecraft:movement.fly';
|
|
1369
|
+
}
|
|
1370
|
+
|
|
1371
|
+
/**
|
|
1372
|
+
* @beta
|
|
1373
|
+
* When added, this move control allows a mob to fly, swim,
|
|
1374
|
+
* climb, etc.
|
|
1375
|
+
*/
|
|
1376
|
+
export class EntityMovementGenericComponent extends EntityBaseMovementComponent {
|
|
1377
|
+
protected constructor();
|
|
1378
|
+
/**
|
|
1379
|
+
* @remarks
|
|
1380
|
+
* Identifier of this component. Should always be
|
|
1381
|
+
* minecraft:movement.generic.
|
|
1382
|
+
*
|
|
1383
|
+
*/
|
|
1384
|
+
static readonly componentId = 'minecraft:movement.generic';
|
|
1385
|
+
}
|
|
1386
|
+
|
|
1387
|
+
/**
|
|
1388
|
+
* @beta
|
|
1389
|
+
* When added, this move control causes the mob to hover.
|
|
1390
|
+
*/
|
|
1391
|
+
export class EntityMovementHoverComponent extends EntityBaseMovementComponent {
|
|
1392
|
+
protected constructor();
|
|
1393
|
+
/**
|
|
1394
|
+
* @remarks
|
|
1395
|
+
* Identifier of this component. Should always be
|
|
1396
|
+
* minecraft:movement.hover.
|
|
1397
|
+
*
|
|
1398
|
+
*/
|
|
1399
|
+
static readonly componentId = 'minecraft:movement.hover';
|
|
1400
|
+
}
|
|
1401
|
+
|
|
1402
|
+
/**
|
|
1403
|
+
* @beta
|
|
1404
|
+
* Move control that causes the mob to jump as it moves with a
|
|
1405
|
+
* specified delay between jumps.
|
|
1406
|
+
*/
|
|
1407
|
+
export class EntityMovementJumpComponent extends EntityBaseMovementComponent {
|
|
1408
|
+
protected constructor();
|
|
1409
|
+
/**
|
|
1410
|
+
* @remarks
|
|
1411
|
+
* Identifier of this component. Should always be
|
|
1412
|
+
* minecraft:movement.jump.
|
|
1413
|
+
*
|
|
1414
|
+
*/
|
|
1415
|
+
static readonly componentId = 'minecraft:movement.jump';
|
|
1416
|
+
}
|
|
1417
|
+
|
|
1418
|
+
/**
|
|
1419
|
+
* @beta
|
|
1420
|
+
* When added, this move control causes the mob to hop as it
|
|
1421
|
+
* moves.
|
|
1422
|
+
*/
|
|
1423
|
+
export class EntityMovementSkipComponent extends EntityBaseMovementComponent {
|
|
1424
|
+
protected constructor();
|
|
1425
|
+
/**
|
|
1426
|
+
* @remarks
|
|
1427
|
+
* Identifier of this component. Should always be
|
|
1428
|
+
* minecraft:movement.skip.
|
|
1429
|
+
*
|
|
1430
|
+
*/
|
|
1431
|
+
static readonly componentId = 'minecraft:movement.skip';
|
|
1432
|
+
}
|
|
1433
|
+
|
|
1434
|
+
/**
|
|
1435
|
+
* @beta
|
|
1436
|
+
* Sets the distance through which the entity can push through.
|
|
1437
|
+
*/
|
|
1438
|
+
export class EntityPushThroughComponent extends EntityComponent {
|
|
1439
|
+
protected constructor();
|
|
1440
|
+
/**
|
|
1441
|
+
* @remarks
|
|
1442
|
+
* This property can't be edited in read-only mode.
|
|
1443
|
+
*
|
|
1444
|
+
*/
|
|
1445
|
+
value: number;
|
|
1446
|
+
/**
|
|
1447
|
+
* @remarks
|
|
1448
|
+
* Identifier of this component. Should always be
|
|
1449
|
+
* minecraft:push_through.
|
|
1450
|
+
*
|
|
1451
|
+
*/
|
|
1452
|
+
static readonly componentId = 'minecraft:push_through';
|
|
1453
|
+
}
|
|
1454
|
+
|
|
1455
|
+
/**
|
|
1456
|
+
* @beta
|
|
1457
|
+
* Sets the entity's visual size.
|
|
1458
|
+
*/
|
|
1459
|
+
export class EntityScaleComponent extends EntityComponent {
|
|
1460
|
+
protected constructor();
|
|
1461
|
+
/**
|
|
1462
|
+
* @remarks
|
|
1463
|
+
* This property can't be edited in read-only mode.
|
|
1464
|
+
*
|
|
1465
|
+
*/
|
|
1466
|
+
value: number;
|
|
1467
|
+
/**
|
|
1468
|
+
* @remarks
|
|
1469
|
+
* Identifier of this component. Should always be
|
|
1470
|
+
* minecraft:scale.
|
|
1471
|
+
*
|
|
1472
|
+
*/
|
|
1473
|
+
static readonly componentId = 'minecraft:scale';
|
|
1474
|
+
}
|
|
1475
|
+
|
|
1476
|
+
/**
|
|
1477
|
+
* @beta
|
|
1478
|
+
* Skin Id value. Can be used to differentiate skins, such as
|
|
1479
|
+
* base skins for villagers.
|
|
1480
|
+
*/
|
|
1481
|
+
export class EntitySkinIdComponent extends EntityComponent {
|
|
1482
|
+
protected constructor();
|
|
1483
|
+
/**
|
|
1484
|
+
* @remarks
|
|
1485
|
+
* This property can't be edited in read-only mode.
|
|
1486
|
+
*
|
|
1487
|
+
*/
|
|
1488
|
+
value: number;
|
|
1489
|
+
/**
|
|
1490
|
+
* @remarks
|
|
1491
|
+
* Identifier of this component. Should always be
|
|
1492
|
+
* minecraft:skin_id.
|
|
1493
|
+
*
|
|
1494
|
+
*/
|
|
1495
|
+
static readonly componentId = 'minecraft:skin_id';
|
|
1496
|
+
}
|
|
1497
|
+
|
|
1498
|
+
/**
|
|
1499
|
+
* @beta
|
|
1500
|
+
* Used to differentiate the component group of a variant of an
|
|
1501
|
+
* entity from others. (e.g. ocelot, villager).
|
|
1502
|
+
*/
|
|
1503
|
+
export class EntityVariantComponent extends EntityComponent {
|
|
1504
|
+
protected constructor();
|
|
1505
|
+
readonly value: number;
|
|
1506
|
+
/**
|
|
1507
|
+
* @remarks
|
|
1508
|
+
* Identifier of this component. Should always be
|
|
1509
|
+
* minecraft:variant.
|
|
1510
|
+
*
|
|
1511
|
+
*/
|
|
1512
|
+
static readonly componentId = 'minecraft:variant';
|
|
1513
|
+
}
|
|
1514
|
+
|
|
1515
|
+
/**
|
|
1516
|
+
* @beta
|
|
1517
|
+
* When added, this component signifies that this entity wants
|
|
1518
|
+
* to become a jockey.
|
|
1519
|
+
*/
|
|
1520
|
+
export class EntityWantsJockeyComponent extends EntityComponent {
|
|
1521
|
+
protected constructor();
|
|
1522
|
+
/**
|
|
1523
|
+
* @remarks
|
|
1524
|
+
* Identifier of this component. Should always be
|
|
1525
|
+
* minecraft:wants_jockey.
|
|
1526
|
+
*
|
|
1527
|
+
*/
|
|
1528
|
+
static readonly componentId = 'minecraft:wants_jockey';
|
|
806
1529
|
}
|
|
807
1530
|
|
|
808
1531
|
/**
|
|
809
1532
|
* @beta
|
|
810
1533
|
* Base class for item components.
|
|
811
1534
|
*/
|
|
812
|
-
export class ItemComponent {
|
|
1535
|
+
export class ItemComponent extends Component {
|
|
813
1536
|
protected constructor();
|
|
814
1537
|
}
|
|
815
1538
|
|
|
@@ -1266,17 +1989,40 @@ export class World {
|
|
|
1266
1989
|
|
|
1267
1990
|
/**
|
|
1268
1991
|
* @beta
|
|
1992
|
+
* Additional options for when damage has been applied via a
|
|
1993
|
+
* projectile.
|
|
1269
1994
|
*/
|
|
1270
1995
|
export interface EntityApplyDamageByProjectileOptions {
|
|
1996
|
+
/**
|
|
1997
|
+
* @remarks
|
|
1998
|
+
* Optional entity that fired the projectile.
|
|
1999
|
+
*
|
|
2000
|
+
*/
|
|
1271
2001
|
damagingEntity?: Entity;
|
|
2002
|
+
/**
|
|
2003
|
+
* @remarks
|
|
2004
|
+
* Projectile that caused damage.
|
|
2005
|
+
*
|
|
2006
|
+
*/
|
|
1272
2007
|
damagingProjectile: Entity;
|
|
1273
2008
|
}
|
|
1274
2009
|
|
|
1275
2010
|
/**
|
|
1276
2011
|
* @beta
|
|
2012
|
+
* Additional descriptions and metadata for a damage event.
|
|
1277
2013
|
*/
|
|
1278
2014
|
export interface EntityApplyDamageOptions {
|
|
2015
|
+
/**
|
|
2016
|
+
* @remarks
|
|
2017
|
+
* Underlying cause of the damage.
|
|
2018
|
+
*
|
|
2019
|
+
*/
|
|
1279
2020
|
cause: EntityDamageCause;
|
|
2021
|
+
/**
|
|
2022
|
+
* @remarks
|
|
2023
|
+
* Optional entity that caused the damage.
|
|
2024
|
+
*
|
|
2025
|
+
*/
|
|
1280
2026
|
damagingEntity?: Entity;
|
|
1281
2027
|
}
|
|
1282
2028
|
|
|
@@ -1506,10 +2252,27 @@ export interface MusicOptions {
|
|
|
1506
2252
|
|
|
1507
2253
|
/**
|
|
1508
2254
|
* @beta
|
|
2255
|
+
* Additional options for how a sound plays for a player.
|
|
1509
2256
|
*/
|
|
1510
2257
|
export interface PlayerSoundOptions {
|
|
2258
|
+
/**
|
|
2259
|
+
* @remarks
|
|
2260
|
+
* Location of the sound; if not specified, the sound is played
|
|
2261
|
+
* near a player.
|
|
2262
|
+
*
|
|
2263
|
+
*/
|
|
1511
2264
|
location?: Vector3;
|
|
2265
|
+
/**
|
|
2266
|
+
* @remarks
|
|
2267
|
+
* Optional pitch of the sound.
|
|
2268
|
+
*
|
|
2269
|
+
*/
|
|
1512
2270
|
pitch?: number;
|
|
2271
|
+
/**
|
|
2272
|
+
* @remarks
|
|
2273
|
+
* Optional volume of the sound.
|
|
2274
|
+
*
|
|
2275
|
+
*/
|
|
1513
2276
|
volume?: number;
|
|
1514
2277
|
}
|
|
1515
2278
|
|
|
@@ -1526,9 +2289,21 @@ export interface RawMessage {
|
|
|
1526
2289
|
|
|
1527
2290
|
/**
|
|
1528
2291
|
* @beta
|
|
2292
|
+
* Provides a description of a score token to use within a raw
|
|
2293
|
+
* message.
|
|
1529
2294
|
*/
|
|
1530
2295
|
export interface RawMessageScore {
|
|
2296
|
+
/**
|
|
2297
|
+
* @remarks
|
|
2298
|
+
* Name of the score value to match.
|
|
2299
|
+
*
|
|
2300
|
+
*/
|
|
1531
2301
|
name?: string;
|
|
2302
|
+
/**
|
|
2303
|
+
* @remarks
|
|
2304
|
+
* Name of the score value to match.
|
|
2305
|
+
*
|
|
2306
|
+
*/
|
|
1532
2307
|
objective?: string;
|
|
1533
2308
|
}
|
|
1534
2309
|
|
|
@@ -1559,9 +2334,21 @@ export interface Vector3 {
|
|
|
1559
2334
|
|
|
1560
2335
|
/**
|
|
1561
2336
|
* @beta
|
|
2337
|
+
* Contains additional options for a world-level playSound
|
|
2338
|
+
* occurrence.
|
|
1562
2339
|
*/
|
|
1563
2340
|
export interface WorldSoundOptions {
|
|
2341
|
+
/**
|
|
2342
|
+
* @remarks
|
|
2343
|
+
* Pitch of the sound played at the world level.
|
|
2344
|
+
*
|
|
2345
|
+
*/
|
|
1564
2346
|
pitch?: number;
|
|
2347
|
+
/**
|
|
2348
|
+
* @remarks
|
|
2349
|
+
* Relative volume and space by which this sound is heard.
|
|
2350
|
+
*
|
|
2351
|
+
*/
|
|
1565
2352
|
volume?: number;
|
|
1566
2353
|
}
|
|
1567
2354
|
|