@minecraft/server 2.13.0-beta.1.26.70-preview.23 → 2.13.0-beta.1.26.70-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 +534 -111
- package/package.json +2 -2
package/index.d.ts
CHANGED
|
@@ -47,6 +47,10 @@ export enum AimAssistTargetMode {
|
|
|
47
47
|
* function Block.getComponent.
|
|
48
48
|
*/
|
|
49
49
|
export enum BlockComponentTypes {
|
|
50
|
+
/**
|
|
51
|
+
* @beta
|
|
52
|
+
*/
|
|
53
|
+
ClimbableProperties = 'minecraft:climbable',
|
|
50
54
|
DynamicProperties = 'minecraft:dynamic_properties',
|
|
51
55
|
/**
|
|
52
56
|
* @beta
|
|
@@ -96,11 +100,11 @@ export enum BlockComponentTypes {
|
|
|
96
100
|
*/
|
|
97
101
|
PrecipitationInteractions = 'minecraft:precipitation_interactions',
|
|
98
102
|
/**
|
|
99
|
-
* @
|
|
103
|
+
* @rc
|
|
100
104
|
*/
|
|
101
105
|
RecipeCrafting = 'minecraft:recipe_crafting',
|
|
102
106
|
/**
|
|
103
|
-
* @
|
|
107
|
+
* @rc
|
|
104
108
|
*/
|
|
105
109
|
RecipeProcessing = 'minecraft:recipe_processing',
|
|
106
110
|
/**
|
|
@@ -3227,6 +3231,106 @@ export enum TintMethod {
|
|
|
3227
3231
|
Water = 'Water',
|
|
3228
3232
|
}
|
|
3229
3233
|
|
|
3234
|
+
/**
|
|
3235
|
+
* @beta
|
|
3236
|
+
* Why a player's virtual container screen closed.
|
|
3237
|
+
*/
|
|
3238
|
+
export enum VirtualContainerCloseReason {
|
|
3239
|
+
/**
|
|
3240
|
+
* @remarks
|
|
3241
|
+
* The player closed the screen, or their device failed to show
|
|
3242
|
+
* it.
|
|
3243
|
+
*
|
|
3244
|
+
*/
|
|
3245
|
+
PlayerClosed = 'PlayerClosed',
|
|
3246
|
+
/**
|
|
3247
|
+
* @remarks
|
|
3248
|
+
* The player died while the screen was open.
|
|
3249
|
+
*
|
|
3250
|
+
*/
|
|
3251
|
+
PlayerDied = 'PlayerDied',
|
|
3252
|
+
/**
|
|
3253
|
+
* @remarks
|
|
3254
|
+
* The player left the game while the screen was open.
|
|
3255
|
+
*
|
|
3256
|
+
*/
|
|
3257
|
+
PlayerLeft = 'PlayerLeft',
|
|
3258
|
+
/**
|
|
3259
|
+
* @remarks
|
|
3260
|
+
* The player switched to spectator mode while the screen was
|
|
3261
|
+
* open.
|
|
3262
|
+
*
|
|
3263
|
+
*/
|
|
3264
|
+
PlayerSpectating = 'PlayerSpectating',
|
|
3265
|
+
/**
|
|
3266
|
+
* @remarks
|
|
3267
|
+
* The screen was closed by the server, for example by
|
|
3268
|
+
* VirtualContainer.close, or because the player changed
|
|
3269
|
+
* dimension.
|
|
3270
|
+
*
|
|
3271
|
+
*/
|
|
3272
|
+
ServerClosed = 'ServerClosed',
|
|
3273
|
+
/**
|
|
3274
|
+
* @remarks
|
|
3275
|
+
* The player's device did not show the screen because the
|
|
3276
|
+
* player was busy, for example with another menu, or was not
|
|
3277
|
+
* ready to show it. The screen was never shown; try opening it
|
|
3278
|
+
* again later.
|
|
3279
|
+
*
|
|
3280
|
+
*/
|
|
3281
|
+
UserBusy = 'UserBusy',
|
|
3282
|
+
}
|
|
3283
|
+
|
|
3284
|
+
/**
|
|
3285
|
+
* @beta
|
|
3286
|
+
* Reasons that the {@link VirtualContainerOpenError} was
|
|
3287
|
+
* thrown.
|
|
3288
|
+
*/
|
|
3289
|
+
export enum VirtualContainerOpenErrorReason {
|
|
3290
|
+
/**
|
|
3291
|
+
* @remarks
|
|
3292
|
+
* The player already has a container screen open, such as
|
|
3293
|
+
* their inventory, a chest or another virtual container. Try
|
|
3294
|
+
* again after they close it.
|
|
3295
|
+
*
|
|
3296
|
+
*/
|
|
3297
|
+
ContainerScreenOpen = 'ContainerScreenOpen',
|
|
3298
|
+
/**
|
|
3299
|
+
* @remarks
|
|
3300
|
+
* The player is dead. Try again after they respawn.
|
|
3301
|
+
*
|
|
3302
|
+
*/
|
|
3303
|
+
PlayerDead = 'PlayerDead',
|
|
3304
|
+
/**
|
|
3305
|
+
* @remarks
|
|
3306
|
+
* The player is still loading into the world, is changing
|
|
3307
|
+
* dimension, or is standing in a portal. Try again on a later
|
|
3308
|
+
* tick.
|
|
3309
|
+
*
|
|
3310
|
+
*/
|
|
3311
|
+
PlayerNotReady = 'PlayerNotReady',
|
|
3312
|
+
/**
|
|
3313
|
+
* @remarks
|
|
3314
|
+
* The player is sleeping. Try again after they wake up.
|
|
3315
|
+
*
|
|
3316
|
+
*/
|
|
3317
|
+
PlayerSleeping = 'PlayerSleeping',
|
|
3318
|
+
/**
|
|
3319
|
+
* @remarks
|
|
3320
|
+
* The player is in spectator mode.
|
|
3321
|
+
*
|
|
3322
|
+
*/
|
|
3323
|
+
PlayerSpectating = 'PlayerSpectating',
|
|
3324
|
+
/**
|
|
3325
|
+
* @remarks
|
|
3326
|
+
* The player's previous container screen is still closing.
|
|
3327
|
+
* Open the next container once the virtualContainerClose event
|
|
3328
|
+
* for the previous one arrives, or try again on a later tick.
|
|
3329
|
+
*
|
|
3330
|
+
*/
|
|
3331
|
+
PreviousScreenClosing = 'PreviousScreenClosing',
|
|
3332
|
+
}
|
|
3333
|
+
|
|
3230
3334
|
/**
|
|
3231
3335
|
* @beta
|
|
3232
3336
|
* An enumeration with the reason that a watchdog is deciding
|
|
@@ -3311,6 +3415,7 @@ export type BlockComponentReturnType<T extends string> = T extends keyof BlockCo
|
|
|
3311
3415
|
: BlockCustomComponentInstance;
|
|
3312
3416
|
|
|
3313
3417
|
export type BlockComponentTypeMap = {
|
|
3418
|
+
climbable: BlockClimbablePropertiesComponent;
|
|
3314
3419
|
dynamic_properties: BlockDynamicPropertiesComponent;
|
|
3315
3420
|
entity_storage: BlockEntityStorageComponent;
|
|
3316
3421
|
fluid_container: BlockFluidContainerComponent;
|
|
@@ -3318,6 +3423,7 @@ export type BlockComponentTypeMap = {
|
|
|
3318
3423
|
inventory: BlockInventoryComponent;
|
|
3319
3424
|
item_frame: BlockItemFrameComponent;
|
|
3320
3425
|
map_color: BlockMapColorComponent;
|
|
3426
|
+
'minecraft:climbable': BlockClimbablePropertiesComponent;
|
|
3321
3427
|
'minecraft:dynamic_properties': BlockDynamicPropertiesComponent;
|
|
3322
3428
|
'minecraft:entity_storage': BlockEntityStorageComponent;
|
|
3323
3429
|
'minecraft:fluid_container': BlockFluidContainerComponent;
|
|
@@ -5045,6 +5151,44 @@ export class BlockBoundingBoxUtils {
|
|
|
5045
5151
|
static translate(box: BlockBoundingBox, delta: Vector3): BlockBoundingBox;
|
|
5046
5152
|
}
|
|
5047
5153
|
|
|
5154
|
+
/**
|
|
5155
|
+
* @beta
|
|
5156
|
+
* Represents the climbable properties of a block with a
|
|
5157
|
+
* 'minecraft:climbable' component.
|
|
5158
|
+
*/
|
|
5159
|
+
// @ts-ignore Class inheritance allowed for native defined classes
|
|
5160
|
+
export class BlockClimbablePropertiesComponent extends BlockComponent {
|
|
5161
|
+
private constructor();
|
|
5162
|
+
/**
|
|
5163
|
+
* @remarks
|
|
5164
|
+
* Returns whether an entity can climb this block when its feet
|
|
5165
|
+
* are sharing the same position as the block. Returns false
|
|
5166
|
+
* when the block does not define a 'minecraft:climbable'
|
|
5167
|
+
* component.
|
|
5168
|
+
*
|
|
5169
|
+
* @throws This property can throw when used.
|
|
5170
|
+
*
|
|
5171
|
+
* {@link LocationInUnloadedChunkError}
|
|
5172
|
+
*
|
|
5173
|
+
* {@link LocationOutOfWorldBoundariesError}
|
|
5174
|
+
*/
|
|
5175
|
+
readonly canClimb: boolean;
|
|
5176
|
+
/**
|
|
5177
|
+
* @remarks
|
|
5178
|
+
* Returns whether a player on this block can stop descending
|
|
5179
|
+
* and hold their position when sneaking. Returns false when
|
|
5180
|
+
* the block does not define a 'minecraft:climbable' component
|
|
5181
|
+
*
|
|
5182
|
+
* @throws This property can throw when used.
|
|
5183
|
+
*
|
|
5184
|
+
* {@link LocationInUnloadedChunkError}
|
|
5185
|
+
*
|
|
5186
|
+
* {@link LocationOutOfWorldBoundariesError}
|
|
5187
|
+
*/
|
|
5188
|
+
readonly canHoldPositionWhileSneaking: boolean;
|
|
5189
|
+
static readonly componentId = 'minecraft:climbable';
|
|
5190
|
+
}
|
|
5191
|
+
|
|
5048
5192
|
/**
|
|
5049
5193
|
* Base type for components associated with blocks.
|
|
5050
5194
|
*/
|
|
@@ -6347,7 +6491,7 @@ export class BlockPermutation {
|
|
|
6347
6491
|
* Gets a state for the permutation.
|
|
6348
6492
|
*
|
|
6349
6493
|
* @param stateName
|
|
6350
|
-
* Name of the block state
|
|
6494
|
+
* Name of the block state whose value is to be returned.
|
|
6351
6495
|
* @returns
|
|
6352
6496
|
* Returns the state if the permutation has it, else
|
|
6353
6497
|
* `undefined`.
|
|
@@ -6585,7 +6729,7 @@ export class BlockPrecipitationInteractionsComponent extends BlockComponent {
|
|
|
6585
6729
|
}
|
|
6586
6730
|
|
|
6587
6731
|
/**
|
|
6588
|
-
* @
|
|
6732
|
+
* @rc
|
|
6589
6733
|
* Represents a block component that provides access to recipe
|
|
6590
6734
|
* crafting.
|
|
6591
6735
|
*/
|
|
@@ -6620,7 +6764,7 @@ export class BlockRecipeCraftingComponent extends BlockComponent {
|
|
|
6620
6764
|
}
|
|
6621
6765
|
|
|
6622
6766
|
/**
|
|
6623
|
-
* @
|
|
6767
|
+
* @rc
|
|
6624
6768
|
* Represents a block component that provides access to recipe
|
|
6625
6769
|
* processing inputs and output.
|
|
6626
6770
|
*/
|
|
@@ -9519,7 +9663,7 @@ export class Dimension {
|
|
|
9519
9663
|
*
|
|
9520
9664
|
* {@link minecraftcommon.PropertyOutOfBoundsError}
|
|
9521
9665
|
*/
|
|
9522
|
-
playSound(soundId: string, location: Vector3, soundOptions?: WorldSoundOptions): SoundInstance;
|
|
9666
|
+
playSound(soundId: string, location: Entity | Vector3, soundOptions?: WorldSoundOptions): SoundInstance;
|
|
9523
9667
|
/**
|
|
9524
9668
|
* @remarks
|
|
9525
9669
|
* Runs a command synchronously using the context of the
|
|
@@ -20001,7 +20145,7 @@ export class PlayerCancelBreakingBlockAfterEventSignal {
|
|
|
20001
20145
|
}
|
|
20002
20146
|
|
|
20003
20147
|
/**
|
|
20004
|
-
* @
|
|
20148
|
+
* @rc
|
|
20005
20149
|
* Contains information regarding a player crafting a recipe.
|
|
20006
20150
|
*/
|
|
20007
20151
|
export class PlayerCraftRecipeAfterEvent {
|
|
@@ -20027,7 +20171,7 @@ export class PlayerCraftRecipeAfterEvent {
|
|
|
20027
20171
|
}
|
|
20028
20172
|
|
|
20029
20173
|
/**
|
|
20030
|
-
* @
|
|
20174
|
+
* @rc
|
|
20031
20175
|
* Manages callbacks that are connected to when a player crafts
|
|
20032
20176
|
* a recipe.
|
|
20033
20177
|
*/
|
|
@@ -20094,7 +20238,7 @@ export class PlayerCursorInventoryComponent extends EntityComponent {
|
|
|
20094
20238
|
}
|
|
20095
20239
|
|
|
20096
20240
|
/**
|
|
20097
|
-
* @
|
|
20241
|
+
* @rc
|
|
20098
20242
|
* Contains information about an item moved from a container to
|
|
20099
20243
|
* a player's cursor.
|
|
20100
20244
|
*/
|
|
@@ -20115,7 +20259,7 @@ export class PlayerCursorItemGrabAfterEvent {
|
|
|
20115
20259
|
}
|
|
20116
20260
|
|
|
20117
20261
|
/**
|
|
20118
|
-
* @
|
|
20262
|
+
* @rc
|
|
20119
20263
|
* Manages callbacks for items grabbed from a container to a
|
|
20120
20264
|
* player's cursor.
|
|
20121
20265
|
*/
|
|
@@ -20149,7 +20293,7 @@ export class PlayerCursorItemGrabAfterEventSignal {
|
|
|
20149
20293
|
}
|
|
20150
20294
|
|
|
20151
20295
|
/**
|
|
20152
|
-
* @
|
|
20296
|
+
* @rc
|
|
20153
20297
|
* Contains information about an item moved from a player's
|
|
20154
20298
|
* cursor to a container.
|
|
20155
20299
|
*/
|
|
@@ -20170,7 +20314,7 @@ export class PlayerCursorItemReleaseAfterEvent {
|
|
|
20170
20314
|
}
|
|
20171
20315
|
|
|
20172
20316
|
/**
|
|
20173
|
-
* @
|
|
20317
|
+
* @rc
|
|
20174
20318
|
* Manages callbacks for items released from a player's cursor
|
|
20175
20319
|
* to a container.
|
|
20176
20320
|
*/
|
|
@@ -21036,92 +21180,6 @@ export class PlayerInventoryItemChangeAfterEventSignal {
|
|
|
21036
21180
|
unsubscribe(callback: (arg0: PlayerInventoryItemChangeAfterEvent) => void): void;
|
|
21037
21181
|
}
|
|
21038
21182
|
|
|
21039
|
-
/**
|
|
21040
|
-
* @beta
|
|
21041
|
-
* Contains information about an attack initiated through a
|
|
21042
|
-
* player item interaction before it causes effects. Set cancel
|
|
21043
|
-
* to true to prevent the attack.
|
|
21044
|
-
*/
|
|
21045
|
-
export class PlayerItemAttackEntityBeforeEvent {
|
|
21046
|
-
private constructor();
|
|
21047
|
-
/**
|
|
21048
|
-
* @remarks
|
|
21049
|
-
* The normalized world-space direction used for the attack.
|
|
21050
|
-
* For standard client-initiated transaction attacks, this
|
|
21051
|
-
* direction is derived from the client-provided hit position
|
|
21052
|
-
* and the player's server-side eye position. Other attack
|
|
21053
|
-
* paths can provide a server-derived direction. This property
|
|
21054
|
-
* is undefined when the attack path does not provide an aim
|
|
21055
|
-
* direction.
|
|
21056
|
-
*
|
|
21057
|
-
*/
|
|
21058
|
-
readonly aimDirection?: Vector3;
|
|
21059
|
-
/**
|
|
21060
|
-
* @remarks
|
|
21061
|
-
* If set to true, the attack does not cause damage or other
|
|
21062
|
-
* authoritative attack effects.
|
|
21063
|
-
*
|
|
21064
|
-
*/
|
|
21065
|
-
cancel: boolean;
|
|
21066
|
-
/**
|
|
21067
|
-
* @remarks
|
|
21068
|
-
* A snapshot of the item held by the attacking player. This
|
|
21069
|
-
* property is undefined when the player holds no item.
|
|
21070
|
-
*
|
|
21071
|
-
*/
|
|
21072
|
-
readonly itemStack?: ItemStack;
|
|
21073
|
-
/**
|
|
21074
|
-
* @remarks
|
|
21075
|
-
* The player that initiated the attack.
|
|
21076
|
-
*
|
|
21077
|
-
*/
|
|
21078
|
-
readonly player: Player;
|
|
21079
|
-
/**
|
|
21080
|
-
* @remarks
|
|
21081
|
-
* The entity targeted by the attack.
|
|
21082
|
-
*
|
|
21083
|
-
*/
|
|
21084
|
-
readonly target: Entity;
|
|
21085
|
-
}
|
|
21086
|
-
|
|
21087
|
-
/**
|
|
21088
|
-
* @beta
|
|
21089
|
-
* Manages callbacks that run before a player attacks an entity
|
|
21090
|
-
* through an item interaction.
|
|
21091
|
-
*/
|
|
21092
|
-
export class PlayerItemAttackEntityBeforeEventSignal {
|
|
21093
|
-
private constructor();
|
|
21094
|
-
/**
|
|
21095
|
-
* @remarks
|
|
21096
|
-
* Adds a callback that runs before a player attacks an entity
|
|
21097
|
-
* through an item interaction.
|
|
21098
|
-
*
|
|
21099
|
-
* @privilege no-restricted-execution - This function can't be called in restricted-execution mode.
|
|
21100
|
-
*
|
|
21101
|
-
* @privilege early-execution-allowed - This function can be called in early-execution mode.
|
|
21102
|
-
*
|
|
21103
|
-
* @param callback
|
|
21104
|
-
* This closure is called with restricted-execution privilege.
|
|
21105
|
-
* @returns
|
|
21106
|
-
* Closure that is called with restricted-execution privilege.
|
|
21107
|
-
*/
|
|
21108
|
-
subscribe(
|
|
21109
|
-
callback: (arg0: PlayerItemAttackEntityBeforeEvent) => void,
|
|
21110
|
-
): (arg0: PlayerItemAttackEntityBeforeEvent) => void;
|
|
21111
|
-
/**
|
|
21112
|
-
* @remarks
|
|
21113
|
-
* Removes a callback from this event signal.
|
|
21114
|
-
*
|
|
21115
|
-
* @privilege no-restricted-execution - This function can't be called in restricted-execution mode.
|
|
21116
|
-
*
|
|
21117
|
-
* @privilege early-execution-allowed - This function can be called in early-execution mode.
|
|
21118
|
-
*
|
|
21119
|
-
* @param callback
|
|
21120
|
-
* This closure is called with restricted-execution privilege.
|
|
21121
|
-
*/
|
|
21122
|
-
unsubscribe(callback: (arg0: PlayerItemAttackEntityBeforeEvent) => void): void;
|
|
21123
|
-
}
|
|
21124
|
-
|
|
21125
21183
|
/**
|
|
21126
21184
|
* Contains information regarding a player that has joined.
|
|
21127
21185
|
* See the playerSpawn event for more detailed information that
|
|
@@ -22691,7 +22749,7 @@ export class RandomRegionalDifficultyChanceCondition extends LootItemCondition {
|
|
|
22691
22749
|
}
|
|
22692
22750
|
|
|
22693
22751
|
/**
|
|
22694
|
-
* @
|
|
22752
|
+
* @rc
|
|
22695
22753
|
* Provides access to the slots and recipe of a players active
|
|
22696
22754
|
* crafting UI ie. stonecutter.
|
|
22697
22755
|
*/
|
|
@@ -23941,6 +23999,14 @@ export class SoundDurationInfo {
|
|
|
23941
23999
|
*/
|
|
23942
24000
|
export class SoundInstance {
|
|
23943
24001
|
private constructor();
|
|
24002
|
+
/**
|
|
24003
|
+
* @beta
|
|
24004
|
+
* @remarks
|
|
24005
|
+
* The attached entity, or undefined if the sound is not
|
|
24006
|
+
* attached to an entity.
|
|
24007
|
+
*
|
|
24008
|
+
*/
|
|
24009
|
+
readonly attachedEntity?: Entity;
|
|
23944
24010
|
/**
|
|
23945
24011
|
* @remarks
|
|
23946
24012
|
* Gets duration and playback information for this sound.
|
|
@@ -25215,6 +25281,278 @@ export class TripWireTripAfterEventSignal {
|
|
|
25215
25281
|
unsubscribe(callback: (arg0: TripWireTripAfterEvent) => void): void;
|
|
25216
25282
|
}
|
|
25217
25283
|
|
|
25284
|
+
/**
|
|
25285
|
+
* @beta
|
|
25286
|
+
* A container that only exists in memory. It is not tied to a
|
|
25287
|
+
* block, an entity or the world, is never saved, and is
|
|
25288
|
+
* destroyed once the script no longer references it and no
|
|
25289
|
+
* player is viewing it. It supports the full Container API and
|
|
25290
|
+
* can be shown to any number of players at once with open.
|
|
25291
|
+
* When the world shuts down or scripts reload, open screens
|
|
25292
|
+
* close without raising close events; save the contents from
|
|
25293
|
+
* system.beforeEvents.shutdown if they need to outlive the
|
|
25294
|
+
* session.
|
|
25295
|
+
*/
|
|
25296
|
+
// @ts-ignore Class inheritance allowed for native defined classes
|
|
25297
|
+
export class VirtualContainer extends Container {
|
|
25298
|
+
private constructor();
|
|
25299
|
+
/**
|
|
25300
|
+
* @remarks
|
|
25301
|
+
* The heading shown on the container screen. It is localized
|
|
25302
|
+
* when it names a localization key.
|
|
25303
|
+
*
|
|
25304
|
+
*/
|
|
25305
|
+
readonly title: string;
|
|
25306
|
+
/**
|
|
25307
|
+
* @remarks
|
|
25308
|
+
* Requests closure of the container screen of a player, or of
|
|
25309
|
+
* every player viewing this container when no player is given.
|
|
25310
|
+
* From then on, those players can no longer change the
|
|
25311
|
+
* container through their screens. Each screen raises a
|
|
25312
|
+
* VirtualContainerCloseAfterEvent with the ServerClosed reason
|
|
25313
|
+
* after the client has closed its UI and pending inventory
|
|
25314
|
+
* requests have finished. Closure may complete on a later
|
|
25315
|
+
* tick.
|
|
25316
|
+
*
|
|
25317
|
+
* @privilege no-restricted-execution - This function can't be called in restricted-execution mode.
|
|
25318
|
+
*
|
|
25319
|
+
* @param player
|
|
25320
|
+
* The player whose screen to close. When omitted, every
|
|
25321
|
+
* viewer's screen is closed.
|
|
25322
|
+
* @returns
|
|
25323
|
+
* The number of screens asked to close. A screen that is
|
|
25324
|
+
* already closing is not counted again.
|
|
25325
|
+
* @throws
|
|
25326
|
+
* Throws if the given player is no longer valid.
|
|
25327
|
+
*
|
|
25328
|
+
* {@link InvalidEntityError}
|
|
25329
|
+
*/
|
|
25330
|
+
close(player?: Player): number;
|
|
25331
|
+
/**
|
|
25332
|
+
* @remarks
|
|
25333
|
+
* Gets the players currently viewing this container.
|
|
25334
|
+
*
|
|
25335
|
+
* @returns
|
|
25336
|
+
* The players that have a screen open onto this container.
|
|
25337
|
+
*/
|
|
25338
|
+
getViewers(): Player[];
|
|
25339
|
+
/**
|
|
25340
|
+
* @remarks
|
|
25341
|
+
* Shows a chest style screen onto this container to a player.
|
|
25342
|
+
* Only that player sees the screen; any number of players can
|
|
25343
|
+
* view the same container at once, each with a screen of their
|
|
25344
|
+
* own. Changing dimension closes the screen with the
|
|
25345
|
+
* ServerClosed reason, dying closes it with the PlayerDied
|
|
25346
|
+
* reason, and switching to spectator mode closes it with the
|
|
25347
|
+
* PlayerSpectating reason.
|
|
25348
|
+
*
|
|
25349
|
+
* @privilege no-restricted-execution - This function can't be called in restricted-execution mode.
|
|
25350
|
+
*
|
|
25351
|
+
* @param player
|
|
25352
|
+
* The player to show the container to.
|
|
25353
|
+
* @throws
|
|
25354
|
+
* Throws VirtualContainerOpenError when the screen request
|
|
25355
|
+
* cannot be sent, with a reason that names why, such as the
|
|
25356
|
+
* player still loading or already having a container screen
|
|
25357
|
+
* open; try again later. Not throwing means the request was
|
|
25358
|
+
* sent, not that the screen has already appeared: the player's
|
|
25359
|
+
* device can still decline to show it, which closes it with
|
|
25360
|
+
* the UserBusy reason. Throws InvalidEntityError if the player
|
|
25361
|
+
* is no longer valid or is leaving the game.
|
|
25362
|
+
*
|
|
25363
|
+
* {@link minecraftcommon.EngineError}
|
|
25364
|
+
*
|
|
25365
|
+
* {@link InvalidEntityError}
|
|
25366
|
+
*
|
|
25367
|
+
* {@link VirtualContainerOpenError}
|
|
25368
|
+
*/
|
|
25369
|
+
open(player: Player): void;
|
|
25370
|
+
}
|
|
25371
|
+
|
|
25372
|
+
/**
|
|
25373
|
+
* @beta
|
|
25374
|
+
* Contains information about a player's virtual container
|
|
25375
|
+
* screen that closed, including the contents of the container
|
|
25376
|
+
* at that moment.
|
|
25377
|
+
*/
|
|
25378
|
+
export class VirtualContainerCloseAfterEvent {
|
|
25379
|
+
private constructor();
|
|
25380
|
+
/**
|
|
25381
|
+
* @remarks
|
|
25382
|
+
* The container whose screen closed.
|
|
25383
|
+
*
|
|
25384
|
+
*/
|
|
25385
|
+
readonly container: VirtualContainer;
|
|
25386
|
+
/**
|
|
25387
|
+
* @remarks
|
|
25388
|
+
* The contents of every slot of the container when the screen
|
|
25389
|
+
* closed. Empty slots are undefined. Storage items such as
|
|
25390
|
+
* bundles hold their contents as they were at that moment.
|
|
25391
|
+
*
|
|
25392
|
+
*/
|
|
25393
|
+
readonly items: (ItemStack | undefined)[];
|
|
25394
|
+
/**
|
|
25395
|
+
* @remarks
|
|
25396
|
+
* The player whose screen closed. When the reason is
|
|
25397
|
+
* PlayerLeft the player is no longer valid.
|
|
25398
|
+
*
|
|
25399
|
+
*/
|
|
25400
|
+
readonly player: Player;
|
|
25401
|
+
/**
|
|
25402
|
+
* @remarks
|
|
25403
|
+
* Why the screen closed.
|
|
25404
|
+
*
|
|
25405
|
+
*/
|
|
25406
|
+
readonly reason: VirtualContainerCloseReason;
|
|
25407
|
+
}
|
|
25408
|
+
|
|
25409
|
+
/**
|
|
25410
|
+
* @beta
|
|
25411
|
+
* Manages callbacks that are invoked when a player's virtual
|
|
25412
|
+
* container screen closes.
|
|
25413
|
+
*/
|
|
25414
|
+
export class VirtualContainerCloseAfterEventSignal {
|
|
25415
|
+
private constructor();
|
|
25416
|
+
/**
|
|
25417
|
+
* @remarks
|
|
25418
|
+
* Adds a callback that will be called when a player's virtual
|
|
25419
|
+
* container screen closes.
|
|
25420
|
+
*
|
|
25421
|
+
* @privilege no-restricted-execution - This function can't be called in restricted-execution mode.
|
|
25422
|
+
*
|
|
25423
|
+
* @privilege early-execution-allowed - This function can be called in early-execution mode.
|
|
25424
|
+
*
|
|
25425
|
+
* @param callback
|
|
25426
|
+
* Function callback that is called when this event fires.
|
|
25427
|
+
* @param options
|
|
25428
|
+
* Additional filtering options for the event subscription.
|
|
25429
|
+
*/
|
|
25430
|
+
subscribe(
|
|
25431
|
+
callback: (arg0: VirtualContainerCloseAfterEvent) => void,
|
|
25432
|
+
options?: VirtualContainerEventOptions,
|
|
25433
|
+
): (arg0: VirtualContainerCloseAfterEvent) => void;
|
|
25434
|
+
/**
|
|
25435
|
+
* @remarks
|
|
25436
|
+
* Removes a callback from being called when a player's virtual
|
|
25437
|
+
* container screen closes.
|
|
25438
|
+
*
|
|
25439
|
+
* @privilege no-restricted-execution - This function can't be called in restricted-execution mode.
|
|
25440
|
+
*
|
|
25441
|
+
* @privilege early-execution-allowed - This function can be called in early-execution mode.
|
|
25442
|
+
*
|
|
25443
|
+
*/
|
|
25444
|
+
unsubscribe(callback: (arg0: VirtualContainerCloseAfterEvent) => void): void;
|
|
25445
|
+
}
|
|
25446
|
+
|
|
25447
|
+
/**
|
|
25448
|
+
* @beta
|
|
25449
|
+
* Contains information about a slot of a virtual container
|
|
25450
|
+
* that a player changed through its screen. Changes made by
|
|
25451
|
+
* scripts do not raise this event.
|
|
25452
|
+
*/
|
|
25453
|
+
export class VirtualContainerItemChangeAfterEvent {
|
|
25454
|
+
private constructor();
|
|
25455
|
+
/**
|
|
25456
|
+
* @remarks
|
|
25457
|
+
* The item that was in the slot before the change, if any. A
|
|
25458
|
+
* storage item such as a bundle holds its contents as they
|
|
25459
|
+
* were at the change, unless it was dropped from the slot onto
|
|
25460
|
+
* the ground: its contents then go to the dropped item.
|
|
25461
|
+
*
|
|
25462
|
+
*/
|
|
25463
|
+
readonly beforeItemStack?: ItemStack;
|
|
25464
|
+
/**
|
|
25465
|
+
* @remarks
|
|
25466
|
+
* The container that changed.
|
|
25467
|
+
*
|
|
25468
|
+
*/
|
|
25469
|
+
readonly container: VirtualContainer;
|
|
25470
|
+
/**
|
|
25471
|
+
* @remarks
|
|
25472
|
+
* The item in the slot after the change, if any. A storage
|
|
25473
|
+
* item such as a bundle holds its contents as they were at the
|
|
25474
|
+
* change.
|
|
25475
|
+
*
|
|
25476
|
+
*/
|
|
25477
|
+
readonly itemStack?: ItemStack;
|
|
25478
|
+
/**
|
|
25479
|
+
* @remarks
|
|
25480
|
+
* The player who made the change.
|
|
25481
|
+
*
|
|
25482
|
+
*/
|
|
25483
|
+
readonly player: Player;
|
|
25484
|
+
/**
|
|
25485
|
+
* @remarks
|
|
25486
|
+
* The slot that changed.
|
|
25487
|
+
*
|
|
25488
|
+
*/
|
|
25489
|
+
readonly slot: number;
|
|
25490
|
+
}
|
|
25491
|
+
|
|
25492
|
+
/**
|
|
25493
|
+
* @beta
|
|
25494
|
+
* Manages callbacks that are invoked when a player changes a
|
|
25495
|
+
* slot of a virtual container.
|
|
25496
|
+
*/
|
|
25497
|
+
export class VirtualContainerItemChangeAfterEventSignal {
|
|
25498
|
+
private constructor();
|
|
25499
|
+
/**
|
|
25500
|
+
* @remarks
|
|
25501
|
+
* Adds a callback that will be called when a player changes a
|
|
25502
|
+
* slot of a virtual container.
|
|
25503
|
+
*
|
|
25504
|
+
* @privilege no-restricted-execution - This function can't be called in restricted-execution mode.
|
|
25505
|
+
*
|
|
25506
|
+
* @privilege early-execution-allowed - This function can be called in early-execution mode.
|
|
25507
|
+
*
|
|
25508
|
+
* @param callback
|
|
25509
|
+
* Function callback that is called when this event fires.
|
|
25510
|
+
* @param options
|
|
25511
|
+
* Additional filtering options for the event subscription.
|
|
25512
|
+
*/
|
|
25513
|
+
subscribe(
|
|
25514
|
+
callback: (arg0: VirtualContainerItemChangeAfterEvent) => void,
|
|
25515
|
+
options?: VirtualContainerEventOptions,
|
|
25516
|
+
): (arg0: VirtualContainerItemChangeAfterEvent) => void;
|
|
25517
|
+
/**
|
|
25518
|
+
* @remarks
|
|
25519
|
+
* Removes a callback from being called when a player changes a
|
|
25520
|
+
* slot of a virtual container.
|
|
25521
|
+
*
|
|
25522
|
+
* @privilege no-restricted-execution - This function can't be called in restricted-execution mode.
|
|
25523
|
+
*
|
|
25524
|
+
* @privilege early-execution-allowed - This function can be called in early-execution mode.
|
|
25525
|
+
*
|
|
25526
|
+
*/
|
|
25527
|
+
unsubscribe(callback: (arg0: VirtualContainerItemChangeAfterEvent) => void): void;
|
|
25528
|
+
}
|
|
25529
|
+
|
|
25530
|
+
/**
|
|
25531
|
+
* @beta
|
|
25532
|
+
* Creates virtual containers: containers that only exist in
|
|
25533
|
+
* memory and belong to the script that created them.
|
|
25534
|
+
*/
|
|
25535
|
+
export class VirtualContainerManager {
|
|
25536
|
+
private constructor();
|
|
25537
|
+
/**
|
|
25538
|
+
* @remarks
|
|
25539
|
+
* Creates a new, empty virtual container.
|
|
25540
|
+
*
|
|
25541
|
+
* @privilege no-restricted-execution - This function can't be called in restricted-execution mode.
|
|
25542
|
+
*
|
|
25543
|
+
* @param options
|
|
25544
|
+
* The number of slots and the title of the container.
|
|
25545
|
+
* @returns
|
|
25546
|
+
* The new container.
|
|
25547
|
+
* @throws
|
|
25548
|
+
* Throws if the size is not between 1 and 54, or if the title
|
|
25549
|
+
* is longer than 256 bytes.
|
|
25550
|
+
*
|
|
25551
|
+
* {@link minecraftcommon.PropertyOutOfBoundsError}
|
|
25552
|
+
*/
|
|
25553
|
+
create(options: VirtualContainerOptions): VirtualContainer;
|
|
25554
|
+
}
|
|
25555
|
+
|
|
25218
25556
|
/**
|
|
25219
25557
|
* @beta
|
|
25220
25558
|
* Contains information related to a script watchdog
|
|
@@ -25588,6 +25926,14 @@ export class World {
|
|
|
25588
25926
|
*
|
|
25589
25927
|
*/
|
|
25590
25928
|
readonly tickingAreaManager: TickingAreaManager;
|
|
25929
|
+
/**
|
|
25930
|
+
* @beta
|
|
25931
|
+
* @remarks
|
|
25932
|
+
* Manager for creating virtual containers, containers that
|
|
25933
|
+
* only exist in memory.
|
|
25934
|
+
*
|
|
25935
|
+
*/
|
|
25936
|
+
readonly virtualContainerManager: VirtualContainerManager;
|
|
25591
25937
|
/**
|
|
25592
25938
|
* @beta
|
|
25593
25939
|
* @remarks
|
|
@@ -26414,7 +26760,7 @@ export class WorldAfterEvents {
|
|
|
26414
26760
|
*/
|
|
26415
26761
|
readonly playerCancelBreakingBlock: PlayerCancelBreakingBlockAfterEventSignal;
|
|
26416
26762
|
/**
|
|
26417
|
-
* @
|
|
26763
|
+
* @rc
|
|
26418
26764
|
* @remarks
|
|
26419
26765
|
* This event fires when a player crafts a recipe.
|
|
26420
26766
|
*
|
|
@@ -26423,7 +26769,7 @@ export class WorldAfterEvents {
|
|
|
26423
26769
|
*/
|
|
26424
26770
|
readonly playerCraftRecipe: PlayerCraftRecipeAfterEventSignal;
|
|
26425
26771
|
/**
|
|
26426
|
-
* @
|
|
26772
|
+
* @rc
|
|
26427
26773
|
* @remarks
|
|
26428
26774
|
* Event signal that fires when a player grabs an item from a
|
|
26429
26775
|
* container to their cursor.
|
|
@@ -26433,7 +26779,7 @@ export class WorldAfterEvents {
|
|
|
26433
26779
|
*/
|
|
26434
26780
|
readonly playerCursorItemGrab: PlayerCursorItemGrabAfterEventSignal;
|
|
26435
26781
|
/**
|
|
26436
|
-
* @
|
|
26782
|
+
* @rc
|
|
26437
26783
|
* @remarks
|
|
26438
26784
|
* Event signal that fires when a player releases an item from
|
|
26439
26785
|
* their cursor into a container.
|
|
@@ -26642,6 +26988,26 @@ export class WorldAfterEvents {
|
|
|
26642
26988
|
*
|
|
26643
26989
|
*/
|
|
26644
26990
|
readonly tripWireTrip: TripWireTripAfterEventSignal;
|
|
26991
|
+
/**
|
|
26992
|
+
* @beta
|
|
26993
|
+
* @remarks
|
|
26994
|
+
* This event fires when a player's virtual container screen
|
|
26995
|
+
* closes, with the container's contents at that moment.
|
|
26996
|
+
*
|
|
26997
|
+
* @privilege early-execution-readable - This property can be read in early-execution mode.
|
|
26998
|
+
*
|
|
26999
|
+
*/
|
|
27000
|
+
readonly virtualContainerClose: VirtualContainerCloseAfterEventSignal;
|
|
27001
|
+
/**
|
|
27002
|
+
* @beta
|
|
27003
|
+
* @remarks
|
|
27004
|
+
* This event fires when a player changes a slot of a virtual
|
|
27005
|
+
* container through its screen.
|
|
27006
|
+
*
|
|
27007
|
+
* @privilege early-execution-readable - This property can be read in early-execution mode.
|
|
27008
|
+
*
|
|
27009
|
+
*/
|
|
27010
|
+
readonly virtualContainerItemChange: VirtualContainerItemChangeAfterEventSignal;
|
|
26645
27011
|
/**
|
|
26646
27012
|
* @remarks
|
|
26647
27013
|
* This event will be triggered when the weather changes within
|
|
@@ -26835,13 +27201,6 @@ export class WorldBeforeEvents {
|
|
|
26835
27201
|
*
|
|
26836
27202
|
*/
|
|
26837
27203
|
readonly playerInteractWithEntity: PlayerInteractWithEntityBeforeEventSignal;
|
|
26838
|
-
/**
|
|
26839
|
-
* @beta
|
|
26840
|
-
* @remarks
|
|
26841
|
-
* @privilege early-execution-readable - This property can be read in early-execution mode.
|
|
26842
|
-
*
|
|
26843
|
-
*/
|
|
26844
|
-
readonly playerItemAttackEntity: PlayerItemAttackEntityBeforeEventSignal;
|
|
26845
27204
|
/**
|
|
26846
27205
|
* @remarks
|
|
26847
27206
|
* Fires when a player leaves the game.
|
|
@@ -29632,7 +29991,7 @@ export interface PlayerBreakingBlockEventOptions {
|
|
|
29632
29991
|
}
|
|
29633
29992
|
|
|
29634
29993
|
/**
|
|
29635
|
-
* @
|
|
29994
|
+
* @rc
|
|
29636
29995
|
* Contains options for filtering player craft recipe events.
|
|
29637
29996
|
*/
|
|
29638
29997
|
export interface PlayerCraftRecipeEventOptions {
|
|
@@ -30698,6 +31057,50 @@ export interface VectorXZ {
|
|
|
30698
31057
|
z: number;
|
|
30699
31058
|
}
|
|
30700
31059
|
|
|
31060
|
+
/**
|
|
31061
|
+
* @beta
|
|
31062
|
+
* Contains optional parameters for registering a virtual
|
|
31063
|
+
* container event.
|
|
31064
|
+
*/
|
|
31065
|
+
export interface VirtualContainerEventOptions {
|
|
31066
|
+
/**
|
|
31067
|
+
* @remarks
|
|
31068
|
+
* If this value is set, this event will only fire for the
|
|
31069
|
+
* virtual containers within this collection.
|
|
31070
|
+
*
|
|
31071
|
+
*/
|
|
31072
|
+
containers?: VirtualContainer[];
|
|
31073
|
+
}
|
|
31074
|
+
|
|
31075
|
+
/**
|
|
31076
|
+
* @beta
|
|
31077
|
+
* Options for creating a virtual container with
|
|
31078
|
+
* VirtualContainerManager.create. The size sets its number of
|
|
31079
|
+
* slots, from 1 to 54, which its screen lays out nine per row.
|
|
31080
|
+
* The optional title is the heading on its screen, which is
|
|
31081
|
+
* empty by default. A title can be up to 256 bytes and is
|
|
31082
|
+
* localized when it names a localization key, in which case
|
|
31083
|
+
* the limit applies to the key rather than the localized text.
|
|
31084
|
+
* Neither can be changed once the container is created.
|
|
31085
|
+
*/
|
|
31086
|
+
export interface VirtualContainerOptions {
|
|
31087
|
+
/**
|
|
31088
|
+
* @remarks
|
|
31089
|
+
* The number of slots in the container, from 1 to 54. The
|
|
31090
|
+
* screen lays them out nine per row.
|
|
31091
|
+
*
|
|
31092
|
+
*/
|
|
31093
|
+
size: number;
|
|
31094
|
+
/**
|
|
31095
|
+
* @remarks
|
|
31096
|
+
* The heading shown on the container screen, up to 256 bytes.
|
|
31097
|
+
* It is localized when it names a localization key. Defaults
|
|
31098
|
+
* to no heading.
|
|
31099
|
+
*
|
|
31100
|
+
*/
|
|
31101
|
+
title?: string;
|
|
31102
|
+
}
|
|
31103
|
+
|
|
30701
31104
|
/**
|
|
30702
31105
|
* Defines a texture and the distance range in which it should
|
|
30703
31106
|
* be displayed. Used within a {@link WaypointTextureSelector}
|
|
@@ -31109,7 +31512,7 @@ export class InvalidPotionEffectTypeError extends Error {
|
|
|
31109
31512
|
}
|
|
31110
31513
|
|
|
31111
31514
|
/**
|
|
31112
|
-
* @
|
|
31515
|
+
* @rc
|
|
31113
31516
|
* Thrown when an invalid recipe identifier is used.
|
|
31114
31517
|
*/
|
|
31115
31518
|
// @ts-ignore Class inheritance allowed for native defined classes
|
|
@@ -31279,6 +31682,26 @@ export class UnloadedChunksError extends Error {
|
|
|
31279
31682
|
private constructor();
|
|
31280
31683
|
}
|
|
31281
31684
|
|
|
31685
|
+
/**
|
|
31686
|
+
* @beta
|
|
31687
|
+
* Error thrown when a virtual container cannot be shown to a
|
|
31688
|
+
* player. Contains a reason code indicating why the screen
|
|
31689
|
+
* request was not sent.
|
|
31690
|
+
*/
|
|
31691
|
+
// @ts-ignore Class inheritance allowed for native defined classes
|
|
31692
|
+
export class VirtualContainerOpenError extends Error {
|
|
31693
|
+
private constructor();
|
|
31694
|
+
/**
|
|
31695
|
+
* @remarks
|
|
31696
|
+
* The {@link VirtualContainerOpenErrorReason} code that
|
|
31697
|
+
* indicates why the screen request was not sent.
|
|
31698
|
+
*
|
|
31699
|
+
* @privilege early-execution-readable - This property can be read in early-execution mode.
|
|
31700
|
+
*
|
|
31701
|
+
*/
|
|
31702
|
+
readonly reason: VirtualContainerOpenErrorReason;
|
|
31703
|
+
}
|
|
31704
|
+
|
|
31282
31705
|
/**
|
|
31283
31706
|
* Error thrown by {@link WorldClock.addTimeMarker} when
|
|
31284
31707
|
* failing to add a time marker to a world clock.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@minecraft/server",
|
|
3
|
-
"version": "2.13.0-beta.1.26.70-preview.
|
|
3
|
+
"version": "2.13.0-beta.1.26.70-preview.24",
|
|
4
4
|
"description": "",
|
|
5
5
|
"contributors": [
|
|
6
6
|
{
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
],
|
|
15
15
|
"peerDependencies": {
|
|
16
16
|
"@minecraft/common": "^1.2.0",
|
|
17
|
-
"@minecraft/vanilla-data": ">=1.20.70 || 1.26.70-preview.
|
|
17
|
+
"@minecraft/vanilla-data": ">=1.20.70 || 1.26.70-preview.24"
|
|
18
18
|
},
|
|
19
19
|
"license": "MIT"
|
|
20
20
|
}
|