Skip to content

Commit 118a130

Browse files
authored
Update writing-a-multithreaded-plugin.md
1 parent 1583c5c commit 118a130

1 file changed

Lines changed: 14 additions & 0 deletions

File tree

shreddedpaper/writing-a-multithreaded-plugin.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,20 @@ Bukkit.getAsyncScheduler().runNow(plugin, t -> {
138138

139139
During most events and commands, you will be on the thread of the player/entity/block that triggered the event or command.
140140

141+
### Use teleportAsync
142+
143+
When teleporting entities or players, be sure to do:
144+
145+
```java
146+
entity.teleportAsync(location);
147+
```
148+
149+
Not this:
150+
151+
```java
152+
entity.teleport(location); // Do not do this
153+
```
154+
141155
## Java gotchas for multithreaded plugins
142156

143157
### Race conditions

0 commit comments

Comments
 (0)