Import - MarkusBordihn/BOs-Easy-NPC GitHub Wiki
Unleash the potential of the import screen to bring NPCs from distant lands into your world. Whether you're collaborating across worlds or exploring the creations of other players, importing NPCs has never been easier.
The import format mirrors the export format, enabling you to seamlessly create your NPCs. Utilizing the NBT format for NPC data storage opens doors to external tools for creating or modifying NPCs.
For a swift process, execute the command /easy_npc preset import <ResourceLocation>
to import an
NPC world file. The command imports the NPC to the defined location and avoids duplication if the
NPC
already exists.
Note: Keep in mind that only presets exported to the world file or loaded as data packs can be imported through this command.
Opt for the default import to swiftly introduce example NPCs to your world. These presets, continually expanding, serve as valuable tools for basic NPCs, especially during testing. The default import screen overwrites the existing NPC, disregarding the stored position.
World import opens the gateway to importing NPCs from world files, perfect for incorporating
characters from other worlds or players. Execute the command /easy_npc preset import
for script or
command block imports. The world import screen, while overwriting existing NPCs, ensures a seamless
transition without utilizing the stored position.
Provide additional positions for the import by using the
command /easy_npc preset import <ResourceLocation> <x> <y> <z>
.
This proves handy when importing an NPC to a precise location.
Import NPCs as new entities without overwriting existing ones or create multiples with the same
preset. Use the command /easy_npc preset import_new <ResourceLocation> <x> <y> <z>
for this
purpose.
For importing NPCs with specific UUIDs, use the
command /easy_npc preset import_new <ResourceLocation> <x> <y> <z> <UUID>
.
This ensures precise identification when referencing NPCs in scripts or command blocks.
Use a command block to import NPCs with the
command /easy_npc preset import <ResourceLocation> <x> <y> <z>
or /easy_npc preset import_new <ResourceLocation> <x> <y> <z>
.
For example:
execute run easy_npc preset import easy_npc:preset/humanoid/professor_quiz.npc.nbt ~ ~ ~
To import NPCs with a .mcfunction file, use the
command execute run easy_npc preset import <ResourceLocation> <x> <y> <z>
or execute run easy_npc preset import_new <ResourceLocation> <x> <y> <z>
.
For example:
execute run easy_npc preset import easy_npc:preset/humanoid/professor_quiz.npc.nbt ~ ~ ~
There is a test function avaible 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
.
Custom import facilitates bringing NPCs from local files, allowing for seamless sharing between players. The custom import screen, like its counterparts, overwrites the existing NPC without utilizing the stored position.