mirror of
https://github.com/FancyInnovations/FancyPlugins.git
synced 2025-12-06 07:43:36 +00:00
docs: add warning about npc registration timing
This commit is contained in:
@@ -65,6 +65,11 @@ To let FancyNpcs handle the NPC, you need to register it. FancyNpcs will take ca
|
|||||||
FancyNpcsPlugin.get().getNpcManager().registerNpc(npc);
|
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);`
|
If you don't want to persist the npc, you can do the following: `npc.setSaveToFile(false);`
|
||||||
!!!
|
!!!
|
||||||
|
|||||||
Reference in New Issue
Block a user