Preset - MarkusBordihn/BOs-Easy-NPC GitHub Wiki
Presets are the heart of Easy NPC, enabling you to create and share NPCs with ease. The import and export features provide a seamless experience for incorporating NPCs into your world or sharing them with other players.
The presets files are stored in the NBT format, enabling you to seamlessly import and export NPCs. You can utilize external NBT tools to create or modify NPCs, making the process more flexible and efficient.
The files additionally contains the data from third party mods that are used with the NPC.
Default presets are a collection of NPCs that come pre-installed with Easy NPC. These presets serve as a foundation for creating NPCs and are perfect for testing or learning the mod.
You can use the
command /easy_npc preset import default <PresetResourceLocation> <x> <y> <z> <UUID>
to import a
default preset into your world.
By using the optional <UUID>
parameter you can specify the UUID of the NPC to replace an existing
NPC with the same UUID.
Importing presets is a breeze with Easy NPC, offering a variety of options to suit your needs.
For a swift process, execute the
command /easy_npc preset import <type> <ResourceLocation> <x> <y> <z> <UUID>
to import a
NPC with a preset to your world.
The command imports the NPC to the defined location (if any) and avoids duplication if the NPC
already exists.
In general the following types are available:
-
custom
for presets from the configuration directoryconfig/easy_npc/preset
-
data
for presets from a data pack -
default
for default presets -
world
for presets from the world file
Examples:
/easy_npc preset import custom easy_npc:preset/humanoid/custom_preset.npc.nbt ~ ~ ~
/easy_npc preset import data easy_npc:preset/humanoid/professor_quiz_datapack.npc.nbt ~ ~ ~
/easy_npc preset import default easy_npc:preset/humanoid/professor_quiz.npc.nbt ~ ~ ~
/easy_npc preset import world easy_npc:preset/humanoid/professor_quiz.npc.nbt ~ ~ ~
Most of the commands using auto-suggestions, so you don't need to guess the resource location.
By using the preset commands you are able to import NPCs to a specific position. This is useful when you want to place the NPC at a specific location in the world or near a player.
There is an extra command available to import a NPC as a new NPC.
By using the command /easy_npc preset import_new ...
instead of /easy_npc preset import ...
the
NPC will be automatically spawned with a new UUID.
This make sure that the NPC is handled as a new entity and not as a replacement for an existing one.
Note: Because of the new UUID the NPC will not be recognized as the same entity as the original one.
For importing NPCs with specific UUIDs, provide the UUID as an additional parameter. This ensures precise identification when referencing NPCs in scripts or command blocks. Make sure to use a valid UUID format, otherwise the import will fail.
To import a NPC with a predefined owner in a single command, you can use the command
/easy_npc preset import_with_owner <type> <ResourceLocation> <x> <y> <z> <Owner>
.
Use a command block to import NPCs with the
command /easy_npc preset import <type> <ResourceLocation> <x> <y> <z> <UUID>
or /easy_npc preset import_new <type> <ResourceLocation> <x> <y> <z> <UUID>
.
For example:
execute run easy_npc preset import default easy_npc:default_preset/humanoid/professor_quiz.npc.nbt ~ ~ ~
To import NPCs with a .mcfunction file, use the
command execute run easy_npc preset import <type> <ResourceLocation> <x> <y> <z> <UUID>
or execute run easy_npc preset import_new <type> <ResourceLocation> <x> <y> <z> <UUID>
.
For example:
tellraw @p {"text":"Import Professor Quiz NPC over datapack!", "color":"gold", "bold":true}
execute run easy_npc preset import data easy_npc:preset/humanoid/professor_quiz_datapack.npc.nbt ~ ~ ~
There is a test function available in the mod to test the import of a NPC with a .mcfunction file.
The function is located at easy_npc:tests/import_npc.mcfunction
, this function could be executed
by using the command /function easy_npc:tests/import_npc
.
The local import screen allows you to import NPCs from local preset files.
The presets are stored in the configuration directory at config/easy_npc/preset/...
.
Please note that the presets itself are not stored in the world file or on the server. This means that the local presets are not available for other players or servers.
The default import screen overwrites allows to overwrite the existing NPC and disregarding the stored position.
World import screen allows you to import NPCs from world files. This is perfect for incorporating characters from adventure maps or other worlds.
The file is stored in the world file at easy_npc/preset/...
.
Custom import lets you import NPCs from a shared config directory, allowing for seamless sharing
between players and servers.
If playing on a server, the custom import will only list the presets available on the server under
the config/easy_npc/preset
directory.
If playing in single-player, the custom import will list all presets available in
the config/easy_npc/preset
directory since the server and client are the same.
This is perfect for sharing NPCs on a server by placing the preset files in the
server's config/easy_npc/preset
directory.
The export feature in Easy NPC is a powerful tool for sharing NPCs with other players or utilizing them in different worlds. It's ideal for creating backups or deploying NPCs in various scenarios like adventure maps or servers.
For a swift process, execute the
command /easy_npc preset export <type> <UUID> <Name>
to export a NPC.
The command imports the NPC to the defined location (if any) and avoids duplication if the NPC
already exists.
In general the following types are available:
-
custom
to export the preset to the server configuration directoryconfig/easy_npc/preset
-
local
to export the preset locally toconfig/easy_npc/preset
-
world
to export the preset to the world file ateasy_npc/preset
Examples:
/easy_npc preset export custom 32580b26-db75-41b0-8d97-f91bff69e4b8 custom_export_file
/easy_npc preset export local 32580b26-db75-41b0-8d97-f91bff69e4b8 local_export_file
/easy_npc preset export world 32580b26-db75-41b0-8d97-f91bff69e4b8 world_export_file
If you target a specific NPC with your cross-hair, the corresponding UUID will be auto-suggested in the command. You can also use target selector, but only the first found entity will be used.
Custom export lets you export the NPC to a local file within your configuration directory
at config/easy_npc/preset/...
.
This is perfect for sharing NPCs or deploying them in alternative worlds.
World export facilitates exporting the NPC directly to the world file at easy_npc/preset/...
.
This is particularly handy when sharing NPCs alongside your map or with players on the server.