Denizen Script Commands


Commands are always written with a '-' before them, and are the core component of any script, the primary way to cause things to happen.
Learn about how commands work in The Beginner's Guide.


Showing 1 out of 184 commands...
NameChat
Syntaxchat [<text>] (no_target/targets:<entity>|...) (talkers:<entity>|...) (range:<#.#>)
Short DescriptionCauses an NPC/NPCs to send a chat message to nearby players.
Full DescriptionChat uses an NPC's speech controller provided by Denizen, typically inside 'interact' or 'task' script-containers.
Typically there is already player and NPC context inside a queue that is using the 'chat' command.
In this case, only a text input is required.
Alternatively, target entities can be specified to have any Entity chat to a different target/targets,
or specify 'no_target' to not send the message to any specific target.

Chat from an NPC is formatted by the settings present in Denizen's config.yml.
Players being chatted to see a slightly different message than surrounding players.
By default, a 'chat' will allow other players nearby to also see the conversation. For example:

- chat 'Hello!'

The player being chatted to, by default the attached Player to the script queue, will see a message 'Jack says to you, Hello!',
however surrounding entities will see something along the lines of 'Jack says to Bob, Hello!'.
The format for this is configurable via the "Denizen/config.yml" file.

If sending messages to the Player without any surrounding entities hearing the message is desirable,
it is often times recommended to instead use the 'narrate' command.
Alternatively, on a server-wide scale, the configuration node for the 'range' can be set to 0, however this is discouraged.
Related TagsNone
Usage Example
# Use to emulate an NPC talking out loud to a Player within an interact script-container.
- chat "Hello, <player.name>! Nice day, eh?"
Usage Example
# Use to have an NPC talk to a group of individuals.
- chat targets:<npc.location.find_players_within[6].filter[has_flag[clan_initiate]]> "Welcome, initiate!"
Synonyms (Search Aid)say, speak
Groupplayer
RequiresCitizens
Sourcehttps://github.com/DenizenScript/Denizen/blob/dev/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/player/ChatCommand.java#L43