Files
FancyPlugins/docs/src/fancynpcs/commands/npc.md
2025-03-14 22:50:14 +01:00

262 lines
7.2 KiB
Markdown

---
order: 10
---
# /Npc
The `/npc` command is the main command for managing NPCs. It allows you to create, modify, and remove NPCs. You can also customize NPCs by changing their type, skin, equipment, and more.
## Manage npcs
### Help about commands
Shows help about all commands.
- **Syntax**: `/npc help [page]`
- **Permissions**: `fancynpcs.command.npc.help`
### Create npc
Creates a new NPC. Can be customized with flags.
- **Syntax**: `/npc create (name) [--position (x y z)] [--world (world)] [--type (type)]`
- **Permissions**: `fancynpcs.command.npc.create`
- Name check is now more strict and only allows `A-Z a-z 0-9 _ - /` characters.
### Copy npc
Copies (duplicates) specified NPC.
- **Syntax**: `/npc copy (npc) (new_name)`
- **Permissions**: `fancynpcs.command.npc.copy`
- Name check is now more strict and only allows `A-Z a-z 0-9 _ - /` characters.
### Remove npc
Removes the specified NPC.
- **Syntax**: `/npc remove (npc)`
- **Permissions**: `fancynpcs.command.npc.remove`
### List all npcs
Lists all NPCs in all worlds. Can be filtered and sorted.
- **Syntax**: `/npc list [--type (type)] [--sort (sort)]`
- **Permissions**: `fancynpcs.command.npc.list`
### Get npc information
Shows information about specified NPC.
- **Syntax**: `/npc info (npc)`
- **Permissions**: `fancynpcs.command.npc.info`
## Customize npcs
### Set type
Changes the type of the NPC.
- **Syntax**: `/npc type (npc) (type)`
- **Permissions**: `fancynpcs.command.npc.type`
### Set display name
Changes displayname of the NPC. Supports MiniMessage, PlaceholderAPI and MiniPlaceholders.
- **Syntax**: `/npc displayname (npc) (@none | name)`
- **Permissions**: `fancynpcs.command.npc.displayname`
- Empty message placeholder is `@none`
### Set skin
Changes skin of the NPC.
- **Syntax**: `/npc skin (npc) (@none | @mirror | name | url | file name) [--slim]`
``@none`` - Removes skin.
``@mirror`` - Mirrors the skin of the player viewing the npc.
``name`` / ``uuid`` - Changes skin to the specified player's skin.
``url`` - Changes skin to the specified URL. The URL must point to a valid skin-image.
``file name`` - Changes skin to the specified image. The image must be located in the ``plugins/FancyNpcs/skins``
directory. Please only provide the file name (e. g. "cool-skin.png").
``--slim`` - Only works for skins set by an URL or file.
- **Permissions**: `fancynpcs.command.npc.skin`
### Set equipment
``set`` - Sets equipment slot of the NPC to item currently held in main hand, none or a specific item type.
``clear`` - Clears equipment slot of the NPC.
``list`` - Lists all equipment slots of the NPC.
- **Syntax**: `/npc equipment (npc) (set | clear | list)`
- **Permissions**: `fancynpcs.command.npc.equipment.(sub)`
- Accepts either `@none`, `@hand` or valid item type as an argument.
### Toggle glowing
Changes glowing state and color of the NPC.
- **Syntax**: `/npc glowing (npc) [disabled | color]`
- **Permissions**: `fancynpcs.command.npc.glowing`
### Show npc in tab
Changes whether the NPC is shown in the player-list. This works only on NPCs of PLAYER type.
Re-connecting to the server might be required for changes to take effect.
- **Syntax**: `/npc show_in_tab (npc) [state]`
- **Permissions**: `fancynpcs.command.npc.show_in_tab`
### Toggle collidable
Changes whether the NPC can collide with other entities.
- **Syntax**: `/npc collidable (npc) [state]`
- **Permissions**: `fancynpcs.command.npc.collidable`
### Edit size
Changes the scale of the size of the NPC.
- **Syntax**: `/npc scale (npc) (factor)`
- **Permissions**: `fancynpcs.command.npc.scale`
### Set attributes
Sets an attribute of the NPC.
- **Syntax**: `/npc attribute (npc) (set | list)`
- **Permissions**: `fancynpcs.command.npc.attribute.(sub)`
## Npc location and rotation
### Turn npc to player
Changes whether the NPC should turn to the player when in range.
- **Syntax**: `/npc turn_to_player (npc) [state]`
- **Permissions**: `fancynpcs.command.npc.turn_to_player`
### Move npc to your location
Teleports specified NPC to your location.
- **Syntax**: `/npc move_here (npc)`
- **Permissions**: `fancynpcs.command.npc.move_to`
### Move npc to a location
Teleports NPC to specified location.
- **Syntax**: `/npc move_to (npc) (x) (y) (z) [world] [--look-in-my-direction]`
- **Permissions**: `fancynpcs.command.npc.move_to`
### Show nearby npcs
Lists all NPCs in your world. Can be filtered and sorted.
- **Syntax**: `/npc nearby [--radius (radius)] [--type (type)] [--sort (sort)]`
- **Permissions**: `fancynpcs.command.npc.nearby`
### Teleport to npc
Teleports you to the specified NPC.
- **Syntax**: `/npc teleport (npc)`
- **Permissions**: `fancynpcs.command.npc.teleport`
- Now **teleports sender** to the NPC. Teleportng **the NPC** to specified location is now handled by `/npc move_to`
command.
## Manage interactions
### Add action
Adds an action to the specified NPC's trigger.
- **Syntax**: `/npc action (npc) (trigger) add (actionType) [value]`
- **Permissions**: `fancynpcs.command.npc.action.add`
### Add action before
Adds an action before the specified index in the NPC's action list for the given trigger.
- **Syntax**: `/npc action (npc) (trigger) add_before (index) (actionType) [value]`
- **Permissions**: `fancynpcs.command.npc.action.addBefore`
### Add action after
Adds an action after the specified index in the NPC's action list for the given trigger.
- **Syntax**: `/npc action (npc) (trigger) add_after (index) (actionType) [value]`
- **Permissions**: `fancynpcs.command.npc.action.addAfter`
### Set action
Sets an action at the specified number in the NPC's action list for the given trigger.
- **Syntax**: `/npc action (npc) (trigger) set (number) (actionType) [value]`
- **Permissions**: `fancynpcs.command.npc.action.set`
### Remove action
Removes an action from the NPC's action list based on the specified number for the given trigger.
- **Syntax**: `/npc action (npc) (trigger) remove (number)`
- **Permissions**: `fancynpcs.command.npc.action.remove`
### Move action up
Moves the action at the specified number up in the NPC's action list for the given trigger.
- **Syntax**: `/npc action (npc) (trigger) move_up (number)`
- **Permissions**: `fancynpcs.command.npc.action.moveUp`
### Move action down
Moves the action at the specified number down in the NPC's action list for the given trigger.
- **Syntax**: `/npc action (npc) (trigger) move_down (number)`
- **Permissions**: `fancynpcs.command.npc.action.moveDown`
### Clear actions
Clears all actions from the NPC for the given trigger.
- **Syntax**: `/npc action (npc) (trigger) clear`
- **Permissions**: `fancynpcs.command.npc.action.clear`
### List actions
Lists all actions for the specified NPC and trigger.
- **Syntax**: `/npc action (npc) (trigger) list`
- **Permissions**: `fancynpcs.command.npc.action.list`
### Interaction cooldown
Changes duration between interactions (cooldown) of the NPC.
- **Syntax**: `/npc interaction_cooldown (npc) (disabled | cooldown)`
- **Permissions**: `fancynpcs.command.npc.interaction_cooldown`
- Formerly known as `/npc interactionCooldown`.
- Uses time duration instead of a number of seconds eg. `2min`. Supported units:
- milliseconds: `ms`
- seconds: `s`
- minutes: `min`
- hours: `h`
- days: `d`
- months: `mo`
- years: `y`