| Name | Trait |
| Syntax | trait (state:true/false/{toggle}) [<trait>] (to:<npc>|...) |
| Short Description | Adds or removes a trait from an NPC. |
| Full Description | This command adds or removes a trait from an NPC.
Use "state:true" to add or "state:false" to remove. If neither is specified, the default is "toggle", which means remove if already present or add if not. Note that a redundant instruction, like adding a trait that the NPC already has, will give an error message. The trait input is simply the name of the trait, like "sentinel". Optionally, specify a list of NPCs to apply the trait to. If unspecified, the linked NPC will be used. |
| Related Tags | <NPCTag.has_trait[<trait>]> Returns whether the NPC has a specified trait.
<NPCTag.traits> Returns a list of all of the NPC's traits.
<server.traits> Returns a list of all available NPC traits on the server.
|
| Usage Example | |
| Usage Example | |
| Group | npc |
| Requires | Citizens |
| Source | https://github.com/DenizenScript/Denizen/blob/dev/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/npc/TraitCommand.java#L29 |