[{"data":1,"prerenderedAt":7},["ShallowReactive",2],{"docs:wiki\u002FGuides\u002FMaking-An-NPC":3},{"html":4,"title":-1,"frontmatter":5},"\u003Cp>\u003Cstrong>Difficulty: Beginner\u003C\u002Fstrong>\u003C\u002Fp>\n\u003Cp>Using a few basic tricks you can use MythicMobs to create highly versatile NPC’s. The basic idea is to create a mob that has no AI\u002Fmovement and doesn’t despawn. We can then attach various mechanics and skills to our NPC mob such as messages, commands, or any skill you can think of.\u003C\u002Fp>\n\u003Ch1>Step 1 - Basic NPC\u003C\u002Fh1>\n\u003Cp>The first step is simply making your mob file, this can be anywhere, for this example we’ll make a NPC subfolder.\u003C\u002Fp>\n\u003Cp>Using the below mob as a base, we can make a simple NPC that just stands still. We are using \u003Ca href=\"https:\u002F\u002Fwww.spigotmc.org\u002Fresources\u002Flibs-disguises-free.81\u002F\">LibsDisguises\u003C\u002Fa> to make the mob look like a player.\u003C\u002Fp>\n\u003Cp>\u003Ccode>plugins\u002FMythicMobs\u002FMobs\u002FNPC\u002FSteve.yml\u003C\u002Fcode>\u003C\u002Fp>\n\u003Cpre class=\"language-yaml\">\u003Ccode class=\"language-yaml\">\u003Cspan class=\"yaml-key\">NPC_Steve\u003C\u002Fspan>\u003Cspan class=\"yaml-punc\">:\u003C\u002Fspan>\n\u003Cspan class=\"yaml-key\">  Type\u003C\u002Fspan>\u003Cspan class=\"yaml-punc\">: \u003C\u002Fspan>\u003Cspan class=\"yaml-plain\">INTERACTION\u003C\u002Fspan>\n\u003Cspan class=\"yaml-key\">  Display\u003C\u002Fspan>\u003Cspan class=\"yaml-punc\">: \u003C\u002Fspan>\u003Cspan class=\"yaml-string\">&#39;Steve the Guide&#39;\u003C\u002Fspan>\n\u003Cspan class=\"yaml-key\">  Disguise\u003C\u002Fspan>\u003Cspan class=\"yaml-punc\">: \u003C\u002Fspan>\u003Cspan class=\"yaml-plain\">Player\u003C\u002Fspan> &lt;\u003Cspan class=\"yaml-plain\">Inherit\u003C\u002Fspan>&gt; \u003Cspan class=\"yaml-plain\">setSkin\u003C\u002Fspan> \u003Cspan class=\"yaml-plain\">Steve\u003C\u002Fspan> \u003Cspan class=\"yaml-plain\">setDynamicName\u003C\u002Fspan> \u003Cspan class=\"yaml-bool\">true\u003C\u002Fspan>\n\u003Cspan class=\"yaml-key\">  Options\u003C\u002Fspan>\u003Cspan class=\"yaml-punc\">:\u003C\u002Fspan>\n\u003Cspan class=\"yaml-key\">    AlwaysShowName\u003C\u002Fspan>\u003Cspan class=\"yaml-punc\">: \u003C\u002Fspan>\u003Cspan class=\"yaml-bool\">true\u003C\u002Fspan>\n\u003Cspan class=\"yaml-key\">    Despawn\u003C\u002Fspan>\u003Cspan class=\"yaml-punc\">: \u003C\u002Fspan>\u003Cspan class=\"yaml-plain\">persistent\u003C\u002Fspan>\n\u003C\u002Fcode>\u003C\u002Fpre>\n\u003Cul>\n\u003Cli>\u003Ccode>NPC_Steve\u003C\u002Fcode> This is what you’ll use to spawn your NPC. \u002Fmm m spawn NPC_Steve\u003C\u002Fli>\n\u003Cli>\u003Ccode>Type: INTERACTION\u003C\u002Fcode> You can use whatever you like but we’ll be using an interaction entity since it has no AI, no sound etc.\u003C\u002Fli>\n\u003Cli>\u003Ccode>Display: 'Steve the Guide'\u003C\u002Fcode> This is what will appear above your NPC’s head.\u003C\u002Fli>\n\u003Cli>\u003Ccode>Disguise: Player &lt;Inherit&gt; setSkin Steve setDynamicName true\u003C\u002Fcode> This is what makes our NPC look like a player. You can replace “Steve” with whatever player’s skin you’d like to use. You must keep the setDynamicName as true so the NPC can use the Display setting. The \u003Ccode>&lt;Inherit&gt;\u003C\u002Fcode> (case-sensitive) placeholder sets the NPC to show its \u003Ccode>Display:\u003C\u002Fcode> name.  For more information about using custom skins \u003Ca href=\"\u002Fdocs\u002Fwiki\u002FMobs\u002FDisguises\">read here\u003C\u002Fa>.\u003C\u002Fli>\n\u003Cli>\u003Ccode>AlwaysShowName: true\u003C\u002Fcode> This makes the nameplate show above your NPC.\u003C\u002Fli>\n\u003Cli>\u003Ccode>Despawn: persistent\u003C\u002Fcode> This will keep your NPC spawned on reloads, restarts and chunk unloads.\u003C\u002Fli>\n\u003C\u002Ful>\n\u003Ch1>Step 2 - Adding messages and commands\u003C\u002Fh1>\n\u003Cp>You can add messages or commands to your NPC using the \u003Ca href=\"\u002Fmechanics\u002Fmessage\">Message\u003C\u002Fa> and \u003Ca href=\"\u002Fmechanics\u002Fcommand\">Command\u003C\u002Fa> mechanics. For this guide we will be using @trigger and onInteract which will show the message or run the command for a user who right clicks the NPC. When you are testing make sure you’re in SURVIVAL mode as creative mode players wont be targetable.\u003C\u002Fp>\n\u003Ch3>Message\u003C\u002Fh3>\n\u003Cp>This example will send a message to the player when they right click the NPC. We are adding the \u003Ca href=\"\u002Fdocs\u002Fwiki\u002FSkills\u002FMechanics#universal-attributes\">Universal Attribute\u003C\u002Fa> \u003Ccode>cd=3\u003C\u002Fcode> which will give it a cooldown of 3 seconds between clicks.\u003C\u002Fp>\n\u003Cpre class=\"language-yaml\">\u003Ccode class=\"language-yaml\">\u003Cspan class=\"yaml-key\">  Skills\u003C\u002Fspan>\u003Cspan class=\"yaml-punc\">:\u003C\u002Fspan>\n  \u003Cspan class=\"yaml-plain\">-\u003C\u002Fspan> \u003Ca class=\"mythic-ref\" data-mythic-ref=\"m:message\">message\u003C\u002Fa>\u003Cspan class=\"yaml-punc\">{\u003C\u002Fspan>\u003Cspan class=\"yaml-plain\">m\u003C\u002Fspan>=&amp;\u003Cspan class=\"yaml-plain\">bWelcome\u003C\u002Fspan> \u003Cspan class=\"yaml-plain\">to\u003C\u002Fspan> \u003Cspan class=\"yaml-plain\">Hypixel\u003C\u002Fspan> &amp;\u003Cspan class=\"yaml-plain\">a\u003C\u002Fspan>&lt;\u003Cspan class=\"yaml-plain\">trigger.name\u003C\u002Fspan>&gt;&amp;\u003Cspan class=\"yaml-plain\">b\u003C\u002Fspan>!;\u003Cspan class=\"yaml-plain\">cd\u003C\u002Fspan>=\u003Cspan class=\"yaml-number\">3\u003C\u002Fspan>\u003Cspan class=\"yaml-punc\">}\u003C\u002Fspan> @\u003Ca class=\"mythic-ref\" data-mythic-ref=\"t:trigger\">trigger\u003C\u002Fa> ~\u003Ca class=\"mythic-ref\" data-mythic-ref=\"tr:onInteract\">onInteract\u003C\u002Fa>\n\u003C\u002Fcode>\u003C\u002Fpre>\n\u003Ch3>Commands\u003C\u002Fh3>\n\u003Cp>This example will open a menu from DeluxeMenus for the player who right clicks the NPC.\u003C\u002Fp>\n\u003Cpre class=\"language-yaml\">\u003Ccode class=\"language-yaml\">\u003Cspan class=\"yaml-key\">  Skills\u003C\u002Fspan>\u003Cspan class=\"yaml-punc\">:\u003C\u002Fspan>\n  \u003Cspan class=\"yaml-plain\">-\u003C\u002Fspan> \u003Ca class=\"mythic-ref\" data-mythic-ref=\"m:command\">command\u003C\u002Fa>\u003Cspan class=\"yaml-punc\">{\u003C\u002Fspan>\u003Cspan class=\"yaml-plain\">c\u003C\u002Fspan>=\u003Cspan class=\"yaml-string\">&quot;dm open shops-blocks &lt;trigger.name&gt;&quot;\u003C\u002Fspan>\u003Cspan class=\"yaml-punc\">}\u003C\u002Fspan> @\u003Ca class=\"mythic-ref\" data-mythic-ref=\"t:trigger\">trigger\u003C\u002Fa> ~\u003Ca class=\"mythic-ref\" data-mythic-ref=\"tr:onInteract\">onInteract\u003C\u002Fa>\n\u003C\u002Fcode>\u003C\u002Fpre>\n\u003Cp>You can add as many skills or mechanics as you like to your NPC, not just messages and commands. You can run any mechanic and any metaskill.\u003C\u002Fp>\n\u003Ch1>Step 3 - ModelEngine (Optional)\u003C\u002Fh1>\n\u003Cp>If you want your NPC to use a ModelEngine model we can remove the disguise line and instead use 2 skills to apply a model to it. We will be using onSpawn and onLoad to make sure the model is always applied to the mob even after restarts.\u003C\u002Fp>\n\u003Cp>You will also need to add a nametag bone to your models to display the name above them. You can do this by opening your model in Blockbench and creating an empty bone and calling it \u003Ccode>tag_name\u003C\u002Fcode>, then upload the newly edited model to your Blueprints folder and use \u003Ccode>\u002Fmeg reload\u003C\u002Fcode>.\u003C\u002Fp>\n\u003Cp>\u003Ccode>plugins\u002FMythicMobs\u002FMobs\u002FNPC\u002FSteve.yml\u003C\u002Fcode>\u003C\u002Fp>\n\u003Cpre class=\"language-yaml\">\u003Ccode class=\"language-yaml\">\u003Cspan class=\"yaml-key\">NPC_Steve\u003C\u002Fspan>\u003Cspan class=\"yaml-punc\">:\u003C\u002Fspan>\n\u003Cspan class=\"yaml-key\">  Type\u003C\u002Fspan>\u003Cspan class=\"yaml-punc\">: \u003C\u002Fspan>\u003Cspan class=\"yaml-plain\">INTERACTION\u003C\u002Fspan>\n\u003Cspan class=\"yaml-key\">  Display\u003C\u002Fspan>\u003Cspan class=\"yaml-punc\">: \u003C\u002Fspan>\u003Cspan class=\"yaml-string\">&#39;Steve&#39;\u003C\u002Fspan>\n\u003Cspan class=\"yaml-key\">  Options\u003C\u002Fspan>\u003Cspan class=\"yaml-punc\">:\u003C\u002Fspan>\n\u003Cspan class=\"yaml-key\">    AlwaysShowName\u003C\u002Fspan>\u003Cspan class=\"yaml-punc\">: \u003C\u002Fspan>\u003Cspan class=\"yaml-bool\">true\u003C\u002Fspan>\n\u003Cspan class=\"yaml-key\">    Collidable\u003C\u002Fspan>\u003Cspan class=\"yaml-punc\">: \u003C\u002Fspan>\u003Cspan class=\"yaml-bool\">false\u003C\u002Fspan>\n\u003Cspan class=\"yaml-key\">    Despawn\u003C\u002Fspan>\u003Cspan class=\"yaml-punc\">: \u003C\u002Fspan>\u003Cspan class=\"yaml-plain\">persistent\u003C\u002Fspan>\n\u003Cspan class=\"yaml-key\">  Skills\u003C\u002Fspan>\u003Cspan class=\"yaml-punc\">:\u003C\u002Fspan>\n  \u003Cspan class=\"yaml-plain\">-\u003C\u002Fspan> \u003Ca class=\"mythic-ref\" data-mythic-ref=\"m:model\">model\u003C\u002Fa>\u003Cspan class=\"yaml-punc\">{\u003C\u002Fspan>\u003Cspan class=\"yaml-plain\">m\u003C\u002Fspan>=\u003Cspan class=\"yaml-plain\">SteveModel\u003C\u002Fspan>;\u003Cspan class=\"yaml-plain\">n\u003C\u002Fspan>=\u003Cspan class=\"yaml-plain\">name\u003C\u002Fspan>;\u003Cspan class=\"yaml-plain\">save\u003C\u002Fspan>=\u003Cspan class=\"yaml-bool\">true\u003C\u002Fspan>\u003Cspan class=\"yaml-punc\">}\u003C\u002Fspan> @\u003Ca class=\"mythic-ref\" data-mythic-ref=\"t:self\">self\u003C\u002Fa> ~\u003Ca class=\"mythic-ref\" data-mythic-ref=\"tr:onSpawn\">onSpawn\u003C\u002Fa>\n\u003C\u002Fcode>\u003C\u002Fpre>\n\u003Cp>With the model mechanic the attributes are\u003C\u002Fp>\n\u003Cul>\n\u003Cli>\u003Ccode>m=SteveModel\u003C\u002Fcode> This is where the name of your model goes, for example we have \u003Ccode>plugins\u002FModelEngine\u002FBlueprints\u002FSteveModel.bbmodel\u003C\u002Fcode>\u003C\u002Fli>\n\u003Cli>\u003Ccode>n=name\u003C\u002Fcode> This is the name of our \u003Ca href=\"https:\u002F\u002Fgit.mythiccraft.io\u002Fmythiccraft\u002Fmodel-engine-4\u002F-\u002Fwikis\u002FModeling\u002FBone-Behaviors#nametag\">nametag bone\u003C\u002Fa> we created.\u003C\u002Fli>\n\u003Cli>\u003Ccode>save=true\u003C\u002Fcode> Tells ModelEngine that the model should be preserved, even across restarts\u003C\u002Fli>\n\u003C\u002Ful>\n\u003Ch1>Step 4 - Spawning the NPC\u003C\u002Fh1>\n\u003Cp>You can now use \u003Ccode>\u002Fmm reload\u003C\u002Fcode> to reload the modified files and add your NPC into the server. Simply stand where you want the NPC to be and use \u003Ccode>\u002Fmm m spawn NPC_Steve\u003C\u002Fcode>.\u003C\u002Fp>\n\u003Cp>You now have a NPC created by MythicMobs.\u003C\u002Fp>\n",{"menu":6},"false",1779063036737]