From 10af5b139091604ffdcf15ebd084448eeef426ae Mon Sep 17 00:00:00 2001 From: PiggyPiglet Date: Mon, 16 Feb 2026 15:37:33 +0800 Subject: [PATCH] Add thread safety warning to docs --- docs/developers/using-placeholderapi.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/docs/developers/using-placeholderapi.md b/docs/developers/using-placeholderapi.md index 4749987..abbfb85 100644 --- a/docs/developers/using-placeholderapi.md +++ b/docs/developers/using-placeholderapi.md @@ -326,6 +326,11 @@ public class JoinExample extends JavaPlugin implements Listener { The following is an example plugin that sends `Welcome %player_name%!` as the Join message, having the placeholders be replaced by PlaceholderAPI. Keeping in mind the [Hytale Player Expansion](https://ecloud.placeholderapi.com/expansions/player-hytale/) needs to be installed to make use of `%player_%` placeholders. + //// info | Thread Safety Warning + Due to Hytale's api design, certain components can only be accessed by specific threads. For full compatibility with placeholderapi, you need to call setPlaceholders on the world thread the player is in. `player.getWorld().execute(() -> )` + By default for player events and player commands, you're already going to be on the world thread so it's not so much of an issue, but you do need to consider it if you're trying to do async work and then call PAPI, e.g. async player chat. + //// + ``` { .java .annotate title="JoinExample.java" } packate com.example.plugin;