Easy NPC

Easy NPC

2M Downloads

[Bug] NPCs can't be imported during "world creation"

tommytheslave opened this issue ยท 7 comments

commented

Npcs don't spawn on world creation. Error - unable to preset npc. Forge 47.2.20 1.20.1.
How to reproduce?

  1. Launch minecraft
  2. Use any mods like Global Gamerules or FTB quest to create npcs on world startup (in my case,for example, /easy_npc preset import_new custom easy_npc:preset/humanoid/dofa.npc.nbt ~1 ~ ~1)
  3. In FTB you can use debug mode,and you'll notice this error.
    What's interesting,if you recreate exactly this command but by your hand, e.g if you start to enter separately by command i.e. /easy_npc then preset e.t.c command will work, and after that if you logout from current world and create another one mobs npcs will spawn unless you close minecraft. Yes, that is strange but it is how it works now.
    And a error is not about permissions,in FTB there is an option "use elevated permissions" , I tried both with that and not, if there is no permission error would be "invalid argument"
commented

The mod itself performing some events on the "world creation" event, so only after the "world is loaded" you can use command like "/easy_npc preset import_new custom".
Currently it's sound like that the other mods are loaded before the NPC mod is ready to use, which leads to issues with spawning them before the "world is loaded".

To help me better understand and address the problem, I need some additional information from you. like the log files with the error messages by executing these commands or any other error message which shows up in this case.

commented

No, unfortunately it is not because the command is executed before the world starts, because the situation repeats with exactly the same error after a while. The situation is hard to explain, I can attach a short video describing the problem.
The logs I found:
[22:57:56] [Server thread/INFO]: Tommytheslave joined the game
[22:57:56] [Server thread/INFO]: Redirecting net/minecraft/world/entity/RelativeMovement
[22:57:56] [Server thread/ERROR]: [ServerLevel[New World]] Error importing custom preset, no preset file found at easy_npc:preset/humanoid/dofa.npc.nbt
[22:57:56] [Server thread/INFO]: Unable to import custom preset easy_npc:preset/humanoid/dofa.npc.nbt !
[22:57:56] [Server thread/ERROR]: [ServerLevel[New World]] Error importing custom preset, no preset file found at easy_npc:preset/humanoid/barry.npc.nbt
[22:57:56] [Server thread/INFO]: Unable to import custom preset easy_npc:preset/humanoid/barry.npc.nbt !
Then,after a minute, I tried to enter commands manually and got the same error:
[23:00:47] [Server thread/ERROR]: [ServerLevel[New World]] Error importing custom preset, no preset file found at easy_npc:preset/humanoid/dofa.npc.nbt
[23:00:47] [Render thread/INFO]: [System] [CHAT] Unable to import custom preset easy_npc:preset/humanoid/dofa.npc.nbt !
[23:00:50] [Server thread/ERROR]: [ServerLevel[New World]] Error importing custom preset, no preset file found at easy_npc:preset/humanoid/dofa.npc.nbt
[23:00:50] [Render thread/INFO]: [System] [CHAT] Unable to import custom preset easy_npc:preset/humanoid/dofa.npc.nbt !
[23:01:02] [Server thread/ERROR]: [ServerLevel[New World]] Error importing custom preset, no preset file found at easy_npc:preset/humanoid/dofa.npc.nbt
[23:01:02] [Render thread/INFO]: [System] [CHAT] Unable to import custom preset easy_npc:preset/humanoid/dofa.npc.nbt !
[23:01:03] [Server thread/ERROR]: [ServerLevel[New World]] Error importing custom preset, no preset file found at easy_npc:preset/humanoid/dofa.npc.nbt
[23:01:03] [Render thread/INFO]: [System] [CHAT] Unable to import custom preset easy_npc:preset/humanoid/dofa.npc.nbt !
If you'll watch, video starts from 1.00

commented

Thanks for the additional details. Unfortunately the video is not working for me.
However according the log file it seems that the file was not found on the server.

Could you please verify that the file is stored in the server config/easy_npc/preset and not only on the client config/easy_npc/preset directory ?

The /easy_npc preset import commands are only considering server side stored presets.
Which mean if the preset is only stored in the general config/easy_npc/preset config directory, it will not work and such message is expected.

commented

Sorry for the confusion, here is video on google drive(video starts from 1:00): video
In addition: After the video, any new created world spawns these 2 npcs as it should be, but if I close minecraft completely,then launch it again and create a new world, the situation will be as it in video, which is strange but it gives me hope that it can be realized
You're right, file is not stored in the server config,only client. Tbh folder named easy_npc even does not generate in serverconfigs of new worlds for me. Maybe this is the main reason, but in my case i need npcs to arrive in situation where user just creates his new world. Should I create the easy_npc folder in serverconfig manully? If so,please advise,Is there any way to do it automatically(for modpack)?

commented

This issue is stale because it has been open 7 days with no activity. Remove stale label or comment or this will be closed in 3 days.

commented

This issue is stale because it has been open 7 days with no activity. Remove stale label or comment or this will be closed in 3 days.

commented

This issue was closed because it has been stalled for 5 days with no activity.