← Назад к ресурсам
C

Crypt: Mimic

Data-driven fake-player NPCs

Modrinth

Описание

[![Made for ModFest: Carnival](https://raw.githubusercontent.com/ModFest/art/v2/badge/svg/carnival/cozy.svg)](https://modfest.net/carnival) Not what I set out to make, but still something cool :3 ### Usage guide #### Spawning `/crypt-mimic `\ The npc will act as an armour stand until it is locked with:\ `/data modify entity Locked set value True`\ While it is unlocked interacting will modify items, once locked dialog actions will show.\ You can also modify model part rotations just as you would an armour stand. NBT tags ``` NpcId - The npc types id ArmourItems - A list of item stack compounds HandItems - A list of item stack compounds Small - Boolean for small model Locked - Boolean for locked model Pose - Compound of pose rotations. Pose.Head - A list of floats, euler for Head rotation. Pose.Body - A list of floats, euler for Body rotation. Pose.LeftArm - A list of floats, euler for Left Arm rotation. Pose.RightArm - A list of floats, euler for Right Arm rotation. Pose.LeftLeg - A list of floats, euler for Left Leg rotation. Pose.RightLeg - A list of floats, euler for Right Leg rotation. ``` #### NPCs `data//crypt-mimic/npc/.json` ```json5 // note: this example uses json5 for the comments, use regular json for actual data { // `name` uses the vanilla Text codec, so you can build fancy things "name": [ // required { "type": "translatable", "translate": "npc...name" } ], // `title` also uses the vanilla Text codec "title": [ // optional { "type": "translatable", "translate": "npc...title" } ], "skin": { // optional "texture": ":textures/entity/npc/.png", // required "hasSlimArms": true // optional, defaults to false }, "action": { // optional "action": "crypt-mimic:show_dialog", // required "value": ":dialog_" // may be required, dependent on `action` } } ``` #### Dialog `data//crypt-mimic/dialog/.json` ```json5 // note: this example uses json5 for the comments, use regular json for actual data { // `text` uses the vanilla Text codec "text": [ // required { "type": "translatable", "translate": "dialog.." } ], "actions": [ // required, even if empty but should contain at least one { "action": "crypt_mimic:show_dialog", // required "value": ":" // may be required, dependent on `action` } ] } ``` #### Custom dialog actions Dialog actions use the `action..` translation key. ```java import gay.pyrrha.mimic.dialog.DialogAction; DialogAction.getEVENT().register((player, entity, action) -> { // do things }); ``` Kotlin Example ```kotlin import gay.pyrrha.mimic.dialog.DialogAction DialogAction.EVENT.register { player, entity, action -> // do things (but in kotlin :3) } ```