Import - MarkusBordihn/BOs-Easy-NPC GitHub Wiki

Import 📥

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.

Format 🧾

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.

Commands 🛠️

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.

Default Import 🌍

Default Import

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 🌎

World Import

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.

Import to Specific 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 as New NPC 🆕

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.

Import as New NPC with Specific UUID 🆔

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.

Import with a Command Block 🧱

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 ~ ~ ~

Command Block Import

Import with a .mcfunction file 📜

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 📤

Custom Import

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.

⚠️ **GitHub.com Fallback** ⚠️