Dialogues Properties

Text lines

This is the message to be sent to the player in each dialogue. Some considerations:

  • You can add multiple lines.

  • You can use PlaceholderAPI variables.

  • You can use the %player% variable to get the player name.

  • You can add the {centered} variable before the name to make the text centered.

  • If you want the player to be able to SKIP the dialogue, just add the %next% variable at the end of it. This variable will be replaced with a button players need to click.

  • You can use JSON format by writing "json: <json-message>".

  • If you want to show the options within the dialogue, use the %option_X% variable. More information about this HERE.

text:
- "&7Hello &6%player%, &7welcome to the city of"
- "&f&lArgond&7. A magnificent place isn't it?"

Time

The time (in seconds) the player has to read the message and continue with the next dialogue.

  • Set it to 0 if you want the next dialogue to be sent instantly along this dialogue. This is useful for showing a dialogue and options at the same time.

  • Set it to -1 if you want the player to click on a button on chat to continue with the dialogue. For this, remember to use the %next% option explained above.

time: 4

Start Options

When finishing this dialogue, the player options from the conversation defined here, will be displayed.

start_options: conversation1

Start Conversation

When finishing this dialogue, the first dialogue from the conversation defined here, will start.

start_conversation: conversation4

Actions and Last Actions

At the beginning (or end) of the dialogue you can execute some actions, like giving the player a potion effect or executing a command. You can learn about all actions CLICKING HERE.

actions:
- "give_potion_effect: BLINDNESS;180;1"
- "give_potion_effect: CONFUSION;180;1"

last_actions:
- "remove_potion_effect: BLINDNESS"
- "remove_potion_effect: CONFUSION"

Show Name

Whether the name of this entity should be displayed on this dialogue.

show_name: false

Save Dialogue Option

A very important option for dialogues is the "Save Dialogue" one. In some cases you will want the user to previously have reach to a certain dialogue in a conversation. For example, the first time a player greets a NPC the following dialogue will show: "Hello citizen, what can I do for you".

But the next time, another different dialogue will be sent, meaning the player already talked to this NPC. If you want something like this to happen, enable this option. This will save this dialogue for the player and will allow the use of the following PlaceholderAPI variable:

%interactions_has_dialogue_<conversation entity>.<conversation>.<dialogue>%

This variable will return true if the player has reached to that dialogue, and false if not.

save_dialogue_to_player: true

Conditional Dialogues

A conditional dialogue is a REPLACEMENT for the dialogue and will be sent to the player ONLY if some requirements are met. For example, we have this dialogue: "Hello adventurer, I hope you are having a great day"

We can add a conditional dialogue that will replace this dialogue ONLY if the player is lower than level 10. This can be done by adding the next requirement: "%player_level% < 10"

We now need to create a conversation with another dialogue, that will replace the original one, and redirect the conditional dialogue to that conversation. In this case I will create a convesation with the dialogue: "I don't speak to novices"

In the config it should look something like this:

conversation1:
    dialogue:
      dialogue1:
        text:
        - '&7Hello adventurer, I hope you are having a great day'
        time: 2
        conditional_dialogue:
          conditional_dialogue1:
            requires:
            - '%player_level% < 10'
            start_conversation: conversation2
conversation2:
    dialogue:
      dialogue1:
        text:
        - '&7I don't speak to novices'
        time: 2

So, as you can see, the conversation will start with the dialogue1 of conversation1, but if the player is lower than level 10, the conversation2 will start instead.

You can find more information about Requirements CLICKING HERE.

Remember you can use the variable from the Save Dialogue option too! (requires PlaceholderAPI)

conversation1:
    dialogue:
      dialogue1:
        text:
        - '&7Hello adventurer, is the first time we met right?'
        time: 2
        save_dialogue_to_player: true
        conditional_dialogue:
          conditional_dialogue1:
            requires:
            - '%interactions_has_dialogue_guard1.conversation1.dialogue1% == true'
            start_conversation: conversation2
conversation2:
    dialogue:
      dialogue1:
        text:
        - '&7Hello again &a%player%'
        time: 2

In this case, the first time the player speaks to the NPC, the dialogue1 for the conversation1 will be sent. The next time instead, the conversation2 will start, since the player has already reached the dialogue1 of conversation1 from the guard1.yml file.

Remember, you can add multiple conditional dialogues. If the conditions for one dialogue are not met, then it will check for the next one. If the requirements are not met for ANY of the conditional dialogues, then the original dialogue will be sent.

Last updated