Easy NPC

Easy NPC

2M Downloads

[Feature Request] A folder where every preset can be easily imported from without the need to have them inside of a already existing world.

xiHinox opened this issue ยท 12 comments

commented

Is your feature request related to a problem? Please describe. ๐Ÿค”
I'm unable/didnt found a way to import NPCs across different worlds. I've figured out how to export them to a world file, but I haven't found a way to summon them using commands without an existing world with those world-exported presets.

Describe the solution you'd like ๐Ÿ’ญ
A possible way would be to create a folder connected to the worlds, from which I can import presets using simple commands. Essentially, this custom folder should be accessible via commands, allowing me to spawn NPCs without relying on world exports or needing an existing world. This would involve the ability to spawn presets from the Custom folder, which contains presets independently of any specific world.

Describe alternatives you've considered ๐Ÿ”„
I attempted to import the presets from the custom config folder, but it didn't work.

commented

I run some tests and notice that the current presets are very limited for the different use-case.
For this reason I currently rewriting the presets commands and presets config screens to allow better support for them.

This includes a auto-suggestion of presets, so that you don't need to "guess" for the correct path.

image

I will try to have this ready by the end of the week, but could not give any promises.

commented

Hey, are there any news about the datapack preset?

commented

Thanks for the request. Could you please clarify the but it didn't work part with the custom config folder ?
The custom config folder is exactly for this kind of use-case and should work across all worlds.

World 1:
image

World 2:
image

image
commented

Thanks for the request. Could you please clarify the but it didn't work part with the custom config folder ? The custom config folder is exactly for this kind of use-case and should work across all worlds.

World 1: image

World 2: image

image

I can also import the pre-made presets from the custom folder... It's just that it doesn't work using the command.

When I try /easy_npc preset import , I can only do this with presets that I would have world-exported, and for that, I would need an existing world that already has these presets. My problem is that it only works manually - I would have to manually import the NPCs from the custom folder first and wold-export them after that, so that the commands work. However, I would find it great if there was a way to also access the custom folder with commands, or that everything could happen automatically - and when you enter the world, for example, the presets automatically load into the worlds-preset folder.

I think the better solution would be to make the commands compatible with the Custoit doesn't work using the command.
-> A good result would be for example:

  1. A random person would download my modpack and start it
  2. there is no world already created - just the standard empty wordfolder etc.
  3. when the person creates a world himself, the presets would load like that (eg. inside of the worlds preset folder - or that the custom folder works for cmds too), that the cmds are already available/usable when a world is created the first time + the person dont need to import them himself.

thank you for your time!
Best regards,
Hinox

commented

Thanks a lot for the detailed feedback. I think I understand your problem in this case.

The "config/easy_npc/preset" folder is only available from the client side.
Because every command like /easy_npc preset import is executed on the server, the server is not considering the "config/easy_npc/preset" folder so far.

I will add an additional command which will consider the "config/easy_npc/preset" on the server side as well.
Maybe (if possible) I will add an command to even import client presets to the server.

However in your specific case, you can use data-packs within your mod pack to have such functionality without using the "config/easy_npc/preset" folder.

image

The import command can use any resource location within your mod pack, so you can even define your own namespace for this.

Examples:

Example Command: /easy_npc preset import easy_npc:preset/humanoid/professor_quiz.npc.nbt 72.81 -60.00 47.51

commented

Thanks a lot for the detailed feedback. I think I understand your problem in this case.

The "config/easy_npc/preset" folder is only available from the client side. Because every command like /easy_npc preset import is executed on the server, the server is not considering the "config/easy_npc/preset" folder so far.

I will add an additional command which will consider the "config/easy_npc/preset" on the server side as well. Maybe (if possible) I will add an command to even import client presets to the server.

However in your specific case, you can use data-packs within your mod pack to have such functionality without using the "config/easy_npc/preset" folder.

image The import command can use any resource location within your mod pack, so you can even define your own namespace for this.

Examples:

Example Command: /easy_npc preset import easy_npc:preset/humanoid/professor_quiz.npc.nbt 72.81 -60.00 47.51

Okk thanks for your quick answer! :D
I read about the way to do it with datapacks but i have no clue how to create one/what i have to do... - is there any tutorial or preset of that kind of datapack where i can just "ctrl + v" my already existing presets?

And btw i thought datapacks should be imported manually into the datapacks folder of an already existing world as well? :o And if not what do i need to change that its going to import automaticly?

Sorry for all that questions - but ur mod is literally the best mod that allows to config NPCs! ,:D

commented

Right now, the easiest solution is to create a data-back and using https://www.curseforge.com/minecraft/mc-mods/drp-global-datapack or https://www.curseforge.com/minecraft/mc-mods/open-loader , which allows global data-packs and resource-packs for your mod pack.

I could create a sample data-pack tomorrow or so, which shows the basic concept and which allows you to just "copy-and-paste" your existing presets and maybe renaming a placeholder like "easy-npc-example" with your own name.

Implementing the "config/easy_npc/preset" folder for the /easy_npc preset import will take a little bit longer, because I currently rewriting and adding new commands.

commented

Ok so i might found a way that works...
I went into the mod file and pasted my presets over there: easy_npc_1.20.1-4.4.0.jar\data\easy_npc\preset\humanoid... Idk if thats a good solution but i looks like its working. Am open to other solutions, if there is a better way!

commented

Right now, the easiest solution is to create a data-back and using https://www.curseforge.com/minecraft/mc-mods/drp-global-datapack or https://www.curseforge.com/minecraft/mc-mods/open-loader , which allows global data-packs and resource-packs for your mod pack.

I could create a sample data-pack tomorrow or so, which shows the basic concept and which allows you to just "copy-and-paste" your existing presets and maybe renaming a placeholder like "easy-npc-example" with your own name.

Implementing the "config/easy_npc/preset" folder for the /easy_npc preset import will take a little bit longer, because I currently rewriting and adding new commands.

I mean if that would be the better Solution + okay for you, I would take it (the sample data-pack)! :D
But what about my solution - is it dangerous for the mod files or does it bring any trouble?

commented

But what about my solution - is it dangerous for the mod files or does it bring any trouble?

For testing, if you don't plan to update the mod pack or if this is for your friends or so, then it should be fine.
However if you plan to release the final mod pack on Curseforge or Modrinth for several users, I'm not recommend using a hard-copy and modified mod file.

If you are using a modified mod file and you want to update the mod file you need to repeat your modification for each release.
Which would be typical once per week for most of my mods.

This means auto-updates will not work or if users of the mod pack manually updating the mod, it will missing your modifications.
Furthermore it could be that some launchers not showing or flagging the mod file as "invalid" because it's not matching with their database.

commented

For testing, if you don't plan to update the mod pack or if this is for your friends or so, then it should be fine. However if you plan to release the final mod pack on Curseforge or Modrinth for several users, I'm not recommend using a hard-copy and modified mod file.

If you are using a modified mod file and you want to update the mod file you need to repeat your modification for each release. Which would be typical once per week for most of my mods.

This means auto-updates will not work or if users of the mod pack manually updating the mod, it will missing your modifications. Furthermore it could be that some launchers not showing or flagging the mod file as "invalid" because it's not matching with their database.

Okay, good to know! Then I'd rather tend to use the datapack preset - thanks for your advice! :D
Where are you going to post it - on here?: https://github.com/MarkusBordihn/BOs-Easy-NPC/wiki

commented

Heey! I just played the new version of Easy NPCs. Everything works perfectly and is like how I imagined! :D Thanks for your fast and awesome solution!

I wanted to ask as well if you would mind adding me on Discord. I noticed in your profile that you are also from Germany (me too), and perhaps we could discuss future ideas or similar topics or maybe I got some ideas you like/are intrested in too. Additionally, you might be interested in how I use your mod to create the storyline for my modpack (possibly as a showcase of what can be achieved with it).

I would be very happy about it, and thank you once again for your work on the community requests!
Cheers Hinox :)

My DC tag would be the same as my username is on github (xihinox).