docs: add warning about npc registration timing

This commit is contained in:
Oliver
2025-03-27 19:43:07 +01:00
parent e59cd1afdc
commit 9e8a8d43c4

View File

@@ -65,6 +65,11 @@ To let FancyNpcs handle the NPC, you need to register it. FancyNpcs will take ca
FancyNpcsPlugin.get().getNpcManager().registerNpc(npc);
```
!!! warning
Do not register npcs in the first few seconds after the server has started. You need to wait at least 10 seconds before registering npcs. Otherwise, the npcs will not get registered correctly.
You can also listen to the `NpcsLoadedEvent` to know when you can register npcs.
!!!
!!!
If you don't want to persist the npc, you can do the following: `npc.setSaveToFile(false);`
!!!