Crypt: Mimic - NPC System for Minecraft
Adds an advanced non-player character system to the game where NPCs appear as real players but are completely controlled by configuration data.
Creating NPCs
To place an NPC in the world, use the command:
/crypt-mimic <identifier> <x> <y> <z> <nbt>
The character initially behaves like an armor stand. To activate the dialogue system, you need to lock it:
/data modify entity <selector> Locked set value True
In the unlocked state, interacting with the NPC allows you to modify items, and after locking, dialogue actions become available. You can also adjust the rotation of model parts similar to armor stands.
NBT Parameters
NpcId - Unique NPC type identifier
ArmourItems - List of items for equipment
HandItems - List of items in hands
Small - Boolean value for small model
Locked - Boolean value for model locking
Pose - Pose and rotation settings
Pose.Head - Head rotation (list of numbers)
Pose.Body - Body rotation (list of numbers)
Pose.LeftArm - Left arm rotation (list of numbers)
Pose.RightArm - Right arm rotation (list of numbers)
Pose.LeftLeg - Left leg rotation (list of numbers)
Pose.RightLeg - Right leg rotation (list of numbers)
NPC Configuration
NPC configuration files are located at:
data/<namespace>/crypt-mimic/npc/<id>.json
{
"name": [
{
"type": "translatable",
"translate": "npc.<namespace>.<id>.name"
}
],
"title": [
{
"type": "translatable",
"translate": "npc.<namespace>.<id>.title"
}
],
"skin": {
"texture": "<namespace>:textures/entity/npc/<id>.png",
"hasSlimArms": true
},
"action": {
"action": "crypt-mimic:showdialog",
"value": "<namespace>:dialog<id>"
}
}
Dialogue System
Dialogue files are located at:
data/<namespace>/crypt-mimic/dialog/<id>.json
{
"text": [
{
"type": "translatable",
"translate": "dialog.<namespace>.<id>"
}
],
"actions": [
{
"action": "crypt_mimic:show_dialog",
"value": "<namespace>:<different_id>"
}
]
}
Custom Actions
For creating custom dialogue actions, use the translation key action.<namespace>.<id>.
Java Example
import gay.pyrrha.mimic.dialog.DialogAction;
DialogAction.getEVENT().register((player, entity, action) -> {
// your logic here
});
Kotlin Example
import gay.pyrrha.mimic.dialog.DialogAction
DialogAction.EVENT.register { player, entity, action ->
// your logic here
}