-
Notifications
You must be signed in to change notification settings - Fork 10
Using Mappet with CustomNPCs
Even though CustomNPCs mod is sort of an alternative to Mappet, Mappet has some weak sides (specifically NPCs), so this page should document some tips and tricks that you can use in order to use powerful parts of both mods to its full potential. Without further ado, here are the tips:
If you want to use a custom model for a CustomNPCs' NPC, there is no really way to do it out of the box. The only way to make CustomNPCs' NPCs to have custom models is by using Metamorph's client side feature called entity selectors. This feature has its own dedicated video tutorial, and there is a section on 02:54 that shows how to use it with CustomNPCs.
The major drawback of this feature is that it's client sided. So if you would want to enforce the model on a server, you would need to make sure that players will have the same configuration files (entity selectors are located in config/metamorph/selectors.json
).
The easiest way to make CustomNPCs open a dialogue upon right clicking them is by following these steps:
- Spawn an NPC using Npc Wand (brown hoe).
- Grab Scripter item (brown shovel), and right click the NPC while holding Scripter item.
- Click on No where it says Enabled (the button should switch to Yes). This is very important, otherwise it won't work!
- Click on + button, which is on the right next to the Settings tab.
- Insert following script:
function interact(event)
{
event.npc.executeCommand("/mp dialogue open " + event.player.name + " dialogue_id")
}
Where dialogue_id
is dialogue's ID (name in the sidebar). This tip is possible thanks to Jvonlins!
To allow Mappet quests to target CustomNPCs' NPCs as a kill objective, follow these steps:
- Spawn an NPC using Npc Wand (brown hoe).
- Grab Scripter item (brown shovel), and right click the NPC while holding Scripter item.
- Click on No where it says Enabled (the button should switch to Yes). This is very important, otherwise it won't work!
- Click on + button, which is on the right next to the Settings tab.
- Insert following script:
function init(event)
{
event.npc.getNbt().setInteger("quest_target", 1);
}
Where quest_target
could be literally any string key, and 1
could also be different value. Then in a quest:
- Create Kill objective (click + on the right of Objectives, and
Add Kill Objective
). - Click Pick entity ID... and find in the list
customnpcs:customnpc
. - Insert into Matching NBT:
{ForgeData:{quest_target:1}}
. - Change Count to something other than
0
.
After that, this quest should be able to recognize killing of an NPC you configured with quest_target
data script as a kill objective. If you can't kill a CustomNPCs' NPC, use the Npc Wand item on it, click Advanced tab, Factions, and pick Aggressive. After that, you should be able to kill that NPC (you may want to change Stats > Respawn options as well).
For different NPCs, you can give them different values other than quest_target
or 1
. When changing that for different NPCs, make sure to reflect those changes in Matching NBT field.
Special thanks to dyamo for giving a tip to use ForgeData
to match the kill objective with an NPC.
If parts of the wiki don't make sense with Mappet's latest version, or you weren't able to recreate examples (i.e. outdated information), feel free to report the page and section that is out of date on community's Discord server (make sure to mention which Mappet’s version did you use).