# CNPC-XMM-addon
CNPC-XMM Addon is a bridge between CustomNPCs and Xaero's Minimap. It allows server admins and map makers to automatically add waypoints to a player's map when they accept or interact with specific quests.
This is perfect for adventure maps, and quest lines where you want to guide players to their next objective without them getting lost.
#✨ Features
Automatic Waypoint Creation:
When a player accepts a quest, a waypoint can be automatically added to their minimap.
Full Customization: Configure the waypoint directly within the CustomNPCs Quest Editor.
Set custom Coordinates (X, Y, Z).
Choose Colors (Red, Green, Blue, Gold, etc.).
Set Titles and Names.
Toggle yIncluded.
Mark as Temp or not.
Scripting API Support:
For advanced users, use JavaScript in CustomNPCs scripts to dynamically create waypoints.
IPlayer.addWaypoint(int x, int y, int z, String name, int color); var waypoint = event.API.createXmmWaypoint(int x, int y, int z, String name, int color); waypoint.applyTo(IPlayer)

#📖 How to Use (GUI Method)
Open the Quest Editor in CustomNPCs.
Select a Quest.
Click the "Map Waypoint" (地图路径点) button (added by this addon).



Configure the location, color, and name of the waypoint.

Save the quest. Now, when a player takes this quest, the waypoint will appear on their map!
# 💻 Scripting Example
```javascript
function interact(a){
var player = a.player;
// Create a waypoint at the player's current location
var waypoint = a.API.createXmmWaypoint(player.blockX, player.blockY, player.blockZ, "Objective", 3);
waypoint.applyTo(player);
}

