Denizen Script Meta Documentation Search


Learn about how Denizen works in The Beginner's Guide.
Showing 5 search results for chats out of 3852 meta-documentation entries...

Partial Name Match Results



Event


Nameplayer chats
Event Lines player chats
Triggerswhen a player chats.
Generated Examplesafter player chats:
on player chats:
Has PlayerAlways. - this adds switches 'flagged:<flag name>' + 'permission:<node>', in addition to the '<player>' link.
Switchesmessage:<matcher> to only process the event if the chat message matches an advanced matcher.
Contexts<context.message> returns the player's message as an Element.
<context.format> returns the chat message's raw format.
<context.full_text> returns the full text of the chat message (ie, the written message with the format applied to it).
<context.recipients> returns a list of all players that will receive the chat.
DetermineElementTag to change the message.
"FORMAT:<ScriptTag>" to set the format script the message should use.
"RAW_FORMAT:<ElementTag>" to set the format directly (without a format script). (Use with caution, avoid if possible).
"RECIPIENTS:<ListTag(PlayerTag)>" to set the list of players that will receive the message.
CancellableTrue - This adds <context.cancelled> and determine 'cancelled' or 'cancelled:false'
Has LocationTrue - This adds the switches 'in:<area>', 'location_flagged:<flag>', ...
GroupPlayer
Warning(s)Using this will forcibly sync the chat thread.
Sourcehttps://github.com/DenizenScript/Denizen/blob/dev/plugin/src/main/java/com/denizenscript/denizen/events/player/ChatScriptEvent.java#L28

Semi-Strong Match Results



Action


Action Lineschat
Triggerswhen a player chats to the NPC.
Contexts<context.message> returns the triggering message
<context.keyword> returns the keyword matched by a RegEx trigger
Determine"CANCELLED" to stop the player from chatting.
ElementTag to change the message.
Sourcehttps://github.com/DenizenScript/Denizen/blob/dev/plugin/src/main/java/com/denizenscript/denizen/scripts/triggers/core/ChatTrigger.java#L110

Event


Nameplayer receives message
Event Lines player receives message
Triggerswhen a player receives any chat message from the server. This does not normally include *player* chat, instead prefer Event:player chats for that.
Generated Exampleson player receives message:
Has PlayerAlways. - this adds switches 'flagged:<flag name>' + 'permission:<node>', in addition to the '<player>' link.
Contexts<context.message> returns an ElementTag of the message.
<context.raw_json> returns an ElementTag of the raw JSON used for the message.
<context.system_message> returns true if the message is a system message (not player chat).
Determine"MESSAGE:<ElementTag>" to change the message.
"RAW_JSON:<ElementTag>" to change the JSON used for the message.
CancellableTrue - This adds <context.cancelled> and determine 'cancelled' or 'cancelled:false'
GroupPlayer
Warning(s)Using this will forcibly sync the chat thread.
Sourcehttps://github.com/DenizenScript/Denizen/blob/dev/plugin/src/main/java/com/denizenscript/denizen/events/player/PlayerReceivesMessageScriptEvent.java#L18

Semi-Decent Match Results



Language


NameChat Triggers
DescriptionChat Triggers are triggered when a player chats to the NPC (usually while standing close to the NPC and facing the NPC).

They can also be triggered by the command "/denizenclickable chat hello" (where 'hello' is replaced with the chat message). This is used for clickable triggers.
This option enforces all the same limitations as chatting directly, but unlike real chat, won't display the message in global chat when there's no match.
This requires players have the permission "denizen.clickable".

Interact scripts are allowed to define a list of possible messages a player may type and the scripts triggered in response.

Within any given step, the format is then as follows:

# Some identifier for the trigger, this only serves to make the sub-triggers unique, and sort them (alphabetically).
1:
    # The trigger message written by a player. The text between // must be typed by a player, the other text is filled automatically.
    trigger: /keyword/ othertext
    script:
    # Your code here
    - wait 1
    # use "<context.message>" for the exact text written by the player.
    - chat "<context.message> eh?"
# You can list as many as you want
2:
    # You can have multi-option triggers, separated by pipes (the "|" symbol). This example matches if player types 'hi', 'hello', OR 'hey'.
    trigger: /hi|hello|hey/
    script:
    - wait 1
    # use "<context.keyword>" for the specific word that was said.
    # this example will respond to players that said 'hi' with "hi there buddy!", 'hello' with "hello there buddy!", etc.
    - chat "<context.keyword> there buddy!"
3:
    # You can have regex triggers. This example matches when the player types any numbers.
    trigger: /regex:\d+/
    script:
    - wait 1
    # use "<context.keyword>" for the text matched by the regex matcher.
    - chat "<context.keyword> eh?"
4:
    # Use '*' as the trigger to match anything at all.
    trigger: /*/
    # Add this line to hide the "[Player -> NPC]: hi" initial trigger message.
    hide trigger message: true
    # Add this line to show the player chat message in the normal chat.
    show as normal chat: true
    script:
    # If you hide the trigger message but not show as normal chat, you might want to fill that spot with something else.
    - narrate "[Player -> NPC]: I don't know how to type the right thing"
    - wait 1
    - chat "Well type 'hello' or any number!"
    - narrate "Click <element[here].on_hover[click me!].on_click[/denizenclickable chat hello]> to auto-activate the 'hello' trigger!"
GroupNPC Interact Scripts
Sourcehttps://github.com/DenizenScript/Denizen/blob/dev/plugin/src/main/java/com/denizenscript/denizen/scripts/triggers/core/ChatTrigger.java#L40
NameFormat Script Containers
DescriptionFormat script containers are very simple script containers used for formatting messages, usually with the 'narrate' command.


Format_Script_Name:

    type: format

    # The only key is the format. The format can use '<[text]>' as a special def to contain the message being sent.
    # '<[name]>' is available as a special def as well for use with the 'on player chats' event to fill the player's name properly.
    # Note that 'special' means special: these tags behave a little funny in certain circumstances.
    # In particular, these can't be used as real tags in some cases, including for example when using a format script as a determine in the 'player chats' event.
    # | All format scripts MUST have this key!
    format: <[name]> says <[text]>
GroupScript Container System
Sourcehttps://github.com/DenizenScript/Denizen/blob/dev/plugin/src/main/java/com/denizenscript/denizen/scripts/containers/core/FormatScriptContainer.java#L19