Creating a Conversation: Config

There are 2 methods for creating a new conversation with a NPC or entity. You can use them both, but I suggest you to start using the first method since it is more interactive and you don't have to touch the config files.

Using the Config file

As well as the first method, you need to create a new conversation entity by using the /interactions create <conversation> command. A new file will be generated, but you'll see that is almost empty, with no conversations or dialogues. You can replace the config with the following text so you can start adding conversations, dialogues and options correctly.

name: '&a&lExample NPC'
starts_with: []
block_movement: true
start_conversation_radius: 0
end_conversation_radius: 5
conversation:
  conversation1:
    dialogue:
      dialogue1:
        text:
        - "&7Hello citizen, what can I do for you?"
        time: 4
    options:
      option1:
        text: "&eTell me about the city."
        start_conversation: conversation2
      option2:
        text: "&eBye"
        start_conversation: conversation3

With the current config we just have one dialogue "Hello citizen, what can I do for you?" that last 4 seconds and then, two options will be displayed to the player. These options currently do nothing since we haven't created the conversation2 and conversation3. The start_conversation path for each option defines what conversation should start when the player selects the option.

conversation:
  conversation1:
    dialogue:
      dialogue1:
        text:
        - "&7Hello citizen, what can I do for you?"
        time: 4
    options:
      option1:
        text: "&eTell me about the city."
        start_conversation: conversation2
      option2:
        text: "&eBye"
        start_conversation: conversation3
  conversation2:
    dialogue:
      dialogue1:
        text:
        - "&7Kryngel is one of the most important cities"
        - "&7of the nation."
        time: 4
      dialogue2:
        text:
        - "&7If you are searching for adventures, you can talk to"
        - "&7Bob in the inn. Anything else?"
        time: 4
  conversation3:
    dialogue:
      dialogue1:
        text:
        - "&7Good luck!"
        time: 1

As you can see now, the conversations 2 and 3 were created. The conversation2 has 2 dialogues and the conversation3 just one. But, for now, when the dialogues of conversation2 are completed, the whole conversation will stop, so we can redirect the player to the options of conversation1 again by adding thestart_options: conversation1 property. If we don't set a start_options for conversation3 it means this conversation will be the last one.

conversation2:
    dialogue:
      dialogue1:
        text:
        - "&7Kryngel is one of the most important cities"
        - "&7of the nation."
        time: 4
      dialogue2:
        text:
        - "&7If you are finding adventures, you can talk to"
        - "&7Bob in the inn. Anything else?"
        time: 4
        start_options: conversation1 

Finally, we need to set a starting point for the conversation, in this case we want the player to right click a NPC called "Guard" so we add this to the starts_with path.

name: '&a&lExample NPC'
starts_with:
- NPC named Guard
block_movement: true
start_conversation_radius: 0
end_conversation_radius: 5

Last updated