Skip to content

Commit d65c4ab

Browse files
Update runCommandAsync 1.19.60 (JaylyDev#96)
* Update runCommandAsync.md * Update runCommandAsync.md * Update runCommandAsync.md * Update runCommandAsync.md * Update runCommandAsync.md * Update runCommandAsync.md * Update runCommandAsync.md * Update runCommandAsync.md * Update system.run.md * Update runCommandAsync.md * Update runCommandAsync.md * Update runCommandAsync.md * Update runCommandAsync.md
1 parent 0546fcb commit d65c4ab

2 files changed

Lines changed: 55 additions & 23 deletions

File tree

docs/MinecraftApi/@minecraft/server/runCommandAsync.md

Lines changed: 52 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,15 @@
33
Runs a particular command asynchronously from the context of the broader dimension.
44
Note that there is a maximum queue of 128 asynchronous commands that can be run in a given tick.
55

6+
Usually, it executes the command in the next tick.
7+
To run command in the same tick, you have to [delay the JS code](./system.run.md#improve-runcommandasync).
8+
69
Returns a `Promise<CommandResult>` . Throws an error **synchronously** if the queue is full.
710

811
## Commands you have to use
912

1013
Normally we recommend avoiding using commands,
11-
however, the following command features are not implemented in scripting API (as of 1.19.50).
14+
however, the following command features are not implemented in scripting API (as of 1.19.60).
1215

1316
### @s
1417

@@ -39,11 +42,16 @@ however, the following command features are not implemented in scripting API (as
3942

4043
### /setblock
4144

42-
1. `/setblock ... destroy`
45+
1. Can't destroy block `/setblock ... destroy`
46+
47+
### /clone
4348

44-
### /fill
49+
1. Can't clone blocks.
50+
2. Can't move blocks.
4551

46-
1. `/fill` is fast.
52+
### /titleraw
53+
54+
1. Can't display raw title.
4755

4856
### /ability
4957

@@ -80,6 +88,7 @@ however, the following command features are not implemented in scripting API (as
8088
### /gamemode
8189

8290
1. Cannot set player's gamemode.
91+
2. Cannot set world default gamemode.
8392

8493
### /locate
8594

@@ -90,27 +99,50 @@ however, the following command features are not implemented in scripting API (as
9099

91100
1. Even though the loot is broken from the start, but it's useful for drop or set the item to players/world.
92101

93-
### /scoreboard
102+
### /setworldspawn
103+
104+
1. Can't get world spawn point.
105+
2. Can't set world spawn point.
106+
107+
### /spawnpoint
108+
109+
1. Can't get player spawn point.
110+
2. Can't set player spawn point.
111+
112+
### /clearspawnpoint
113+
114+
1. Can't clear player spawn point.
115+
116+
### /weather
117+
118+
1. Can't get weather directly.
119+
2. Can't set weather.
120+
121+
### /difficulty
122+
123+
1. Can't set world difficulty.
124+
125+
### /playanimation
126+
127+
1. Can't play client entity animation.
128+
129+
### /mobevent
130+
131+
1. Can't enable/disable mobevent.
94132

95-
1. Cannot add/set/remove/operation/reset players/entities' scores.
133+
### /camerashake
96134

97-
### /time
135+
1. Can't add/stop camera shake for player.
98136

99-
1. Cannot set world's time.
100-
2. Cannot get world's time (relative and daytime).
137+
### /fog
101138

102-
### /xp
139+
1. Can't manage active fog settings for player.
103140

104-
1. Cannot set player's experience.
105-
2. Cannot get player's experience.
141+
### /stopsound
106142

107-
### Other Commands
143+
1. Can't stop playing a sound.
108144

109-
Following commands useful for mapmaking cannot be replaced with JS code:
145+
### /dialogue
110146

111-
1. `/camerashake`
112-
2. `/fog`
113-
3. `/stopsound`
114-
4. `/weather`
115-
5. `/setspawnpoint` `/clearspawnpoint`
116-
6. `/clone`
147+
1. Can't open the NPC dialogue to player.
148+
2. Can't change the dialogue displayed by an NPC.

docs/MinecraftApi/@minecraft/server/system.run.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,9 @@ Other code in the sync part of callback executes before the command.
4949
```javascript
5050
// current tick
5151
system.run(() => {
52-
const { x, y, z } = entity.location; // next tick
53-
const promise = entity.runCommandAsync(`testfor @s[rm=0.1,x=${x},y=${y},z=${z}]`); // next tick after other code
54-
console.warn("test started"); // next tick
52+
const { x, y, z } = entity.location; // next tick before command
53+
const promise = entity.runCommandAsync(`testfor @s[rm=0.1,x=${x},y=${y},z=${z}]`); // next tick
54+
console.warn("test started"); // next tick before command
5555
});
5656
// current tick
5757
```

0 commit comments

Comments
 (0)