Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
MythicMobs MythicMobs
  • Project overview
    • Project overview
    • Details
    • Activity
  • Issues 139
    • Issues 139
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
  • Operations
    • Operations
    • Incidents
  • Analytics
    • Analytics
    • Repository
    • Value Stream
  • Wiki
    • Wiki
  • Members
    • Members
  • Activity
  • Create a new issue
  • Issue Boards
Collapse sidebar
  • MythicCraft
  • MythicMobsMythicMobs
  • Wiki
    • Guides
  • Making an NPC

Making an NPC · Changes

Page history
used INTERACTION in place of Armorstand for the npc type authored Jan 19, 2025 by Lxlp's avatar Lxlp
Show whitespace changes
Inline Side-by-side
Showing with 5 additions and 11 deletions
+5 -11
  • Guides/Making-an-NPC.md Guides/Making-an-NPC.md +5 -11
  • No files found.
Guides/Making-an-NPC.md
View page @ 5fa4e35b
...@@ -9,28 +9,24 @@ The first step is simply making your mob file, this can be anywhere, for this ex ...@@ -9,28 +9,24 @@ The first step is simply making your mob file, this can be anywhere, for this ex
Using the below mob as a base, we can make a simple NPC that just stands still. We are using [LibsDisguises](https://www.spigotmc.org/resources/libs-disguises-free.81/) to make the mob look like a player. Using the below mob as a base, we can make a simple NPC that just stands still. We are using [LibsDisguises](https://www.spigotmc.org/resources/libs-disguises-free.81/) to make the mob look like a player.
`plugins/MythicMobs/Mobs/NPC/Steve.yml` `plugins/MythicMobs/Mobs/NPC/Steve.yml`
```yaml ```yaml
NPC_Steve: NPC_Steve:
Type: ARMOR_STAND Type: INTERACTION
Display: 'Steve' Display: 'Steve'
Disguise: Player Steve setDynamicName true Disguise: Player Steve setDynamicName true
Options: Options:
AlwaysShowName: true AlwaysShowName: true
Collidable: false
Despawn: persistent Despawn: persistent
Skills:
- cancelevent{sync=true} @self ~onDamaged
``` ```
- `NPC_Steve` This is what you'll use to spawn your NPC. /mm m spawn NPC_Steve - `NPC_Steve` This is what you'll use to spawn your NPC. /mm m spawn NPC_Steve
- `Type: ARMOR_STAND` You can use whatever you like but we'll be using armor stand since it has no AI, no sound etc. - `Type: INTERACTION` You can use whatever you like but we'll be using an interaction entity since it has no AI, no sound etc.
- `Display: 'Steve'` This is what will appear above your NPC's head. - `Display: 'Steve'` This is what will appear above your NPC's head.
- `Disguise: Player Steve setDynamicName true` This is what makes our NPC look like a player. You can replace "Steve" with whatever player name you want. You must keep the setDynamicName as true so the NPC can use the Display setting. For more information about using custom skins [read here](/Mobs/Disguises) - `Disguise: Player Steve setDynamicName true` This is what makes our NPC look like a player. You can replace "Steve" with whatever player name you want. You must keep the setDynamicName as true so the NPC can use the Display setting. For more information about using custom skins [read here](/Mobs/Disguises)
- `AlwaysShowName: true` This makes the nameplate show above your NPC. - `AlwaysShowName: true` This makes the nameplate show above your NPC.
- `Collidable: false` This stops the NPC from being pushed around.
- `Despawn: persistent` This will keep your NPC spawned on reloads, restarts and chunk unloads. - `Despawn: persistent` This will keep your NPC spawned on reloads, restarts and chunk unloads.
For the skills we are using a cancelevent onDamaged to stop the mob from taking any damage. We are using a skill rather than Invincible: true as an option as this will prevent *all* damage sources including skills or other plugins.
# Step 2 - Adding messages and commands # Step 2 - Adding messages and commands
...@@ -40,7 +36,6 @@ You can add messages or commands to your NPC using the [Message](/Skills/mechani ...@@ -40,7 +36,6 @@ You can add messages or commands to your NPC using the [Message](/Skills/mechani
This example will send a message to the player when they right click the NPC. We are adding the [Universal Attribute](Skills/Mechanics#universal-attributes) `cd=3` which will give it a cooldown of 3 seconds between clicks. This example will send a message to the player when they right click the NPC. We are adding the [Universal Attribute](Skills/Mechanics#universal-attributes) `cd=3` which will give it a cooldown of 3 seconds between clicks.
```yaml ```yaml
Skills: Skills:
- cancelevent{sync=true} @self ~onDamaged
- message{m=&bWelcome to Hypixel &a<trigger.name>&b!;cd=3} @trigger ~onInteract - message{m=&bWelcome to Hypixel &a<trigger.name>&b!;cd=3} @trigger ~onInteract
``` ```
...@@ -48,7 +43,6 @@ This example will send a message to the player when they right click the NPC. We ...@@ -48,7 +43,6 @@ This example will send a message to the player when they right click the NPC. We
This example will open a menu from DeluxeMenus for the player who right clicks the NPC. This example will open a menu from DeluxeMenus for the player who right clicks the NPC.
```yaml ```yaml
Skills: Skills:
- cancelevent{sync=true} @self ~onDamaged
- command{c="dm open shops-blocks <trigger.name>"} @trigger ~onInteract - command{c="dm open shops-blocks <trigger.name>"} @trigger ~onInteract
``` ```
...@@ -64,7 +58,7 @@ You will also need to add a nametag bone to your models to display the name abov ...@@ -64,7 +58,7 @@ You will also need to add a nametag bone to your models to display the name abov
`plugins/MythicMobs/Mobs/NPC/Steve.yml` `plugins/MythicMobs/Mobs/NPC/Steve.yml`
```yaml ```yaml
NPC_Steve: NPC_Steve:
Type: ARMOR_STAND Type: INTERACTION
Display: 'Steve' Display: 'Steve'
Options: Options:
AlwaysShowName: true AlwaysShowName: true
...@@ -72,7 +66,6 @@ NPC_Steve: ...@@ -72,7 +66,6 @@ NPC_Steve:
Despawn: persistent Despawn: persistent
Skills: Skills:
- model{m=SteveModel;n=name;save=true} @self ~onSpawn - model{m=SteveModel;n=name;save=true} @self ~onSpawn
- cancelevent{sync=true} @self ~onDamaged
``` ```
With the model mechanic the attributes are With the model mechanic the attributes are
...@@ -80,6 +73,7 @@ With the model mechanic the attributes are ...@@ -80,6 +73,7 @@ With the model mechanic the attributes are
- `n=name` This is the name of our [nametag bone](https://git.mythiccraft.io/mythiccraft/model-engine-4/-/wikis/Modeling/Bone-Behaviors#nametag) we created. - `n=name` This is the name of our [nametag bone](https://git.mythiccraft.io/mythiccraft/model-engine-4/-/wikis/Modeling/Bone-Behaviors#nametag) we created.
- `save=true` Tells ModelEngine that the model should be preserved, even across restarts - `save=true` Tells ModelEngine that the model should be preserved, even across restarts
# Step 4 - Spawning the NPC # Step 4 - Spawning the NPC
You can now use `/mm reload` to reload the modified files and add your NPC into the server. Simply stand where you want the NPC to be and use `/mm m spawn NPC_Steve`. You can now use `/mm reload` to reload the modified files and add your NPC into the server. Simply stand where you want the NPC to be and use `/mm m spawn NPC_Steve`.
......
Clone repository
Home
Changelogs
Premium Features
Commands and Permissions
Mythic Add-ons
Compatible Plugins
API Information

Guides
  • Troubleshooting
  • FAQ / Common Issues
  • Examples
Packs

MythicScribe MythicScribe - VSCode Extension

Mobs
  • Mob Options
    • Display Options
  • Mob Levels
  • Mob Factions
  • Power Scaling
  • Damage Modifiers
  • Equipment
  • BossBar
  • Custom AI
  • Custom Kill Messages
  • Threat Tables
  • Immunity Tables
  • Templates
  • Vanilla Overrides
  • Extra: Disguises
  • Extra: ModelEngine

Skills
  • Mechanics
    • Mechanics by Tag
  • Targeters
    • Filters
  • Triggers
  • Conditions
    • In-line conditions
  • Metaskills
  • Placeholders
  • Variables

Items
  • Options
  • Attributes
  • Enchantments
  • Potions
  • Banner Layers
  • Firework

Drops & DropTables
  • Drops
  • DropTables
  • FancyDrops

Spawning
  • Spawners
  • Random Spawns

Stats
  • Custom Stat Options
  • Modifiers
  • Built in Stats

Other
  • Particles Types
  • Audience
  • Equipment Slots
  • Pins
Technical
  • Math
  • Operations
    • Attribute Operations
    • Stats Modifiers
  • SkillTree
  • Advanced User Guides and Techniques