Create a new Quest - LeonidMem/DialogsM-Wiki GitHub Wiki

To create a new dialog just use the command /quest create {name} and click on the NPC to whom you want to attach the quest - it will create a new template (you can use / at the name in any quantity, so it will be placed to the specified folder and will create it if this folder doesn't exist).

Properties of Quest File

DisplayName [Necessary property]

Must be represented as String. This value will be shown to a player when the quest will be added as a quest in progress.

Text [Necessary property]

Must be represented as String. This value will be shown to a player as a dialog when the quest will be completed.

Info

Must be represented as String. This value will be shown to a player when he will use command /quests and hover on the value of Text.

UUID [Necessary property]

Must be represented as String. This value will be converted to UUID and it will try to find attached entity.

Conditions [Necessary property]

Dialogs

Must be represented as String (it will be converted to the list automatically) or List of Strings. If the player doesn't have any dialog from this list as read, the quest can't be completed.

Items

Must be represented as List of Items. An item is an object with five properties:

  • id (necessary) - must be represented as String. This value converts to the Minecraft Material (don't use minecraft:!).

  • count (necessary) - must be represented as Integer. This value represents the needed amount of the item.

  • name - must be represented as String. This value represents the item's name.

  • lore - must be represented as String or List of Strings. This value represents the item's lore/description;

  • nbt - must be represented as String formatted as JSON.

    Tags in nbt can be represented only as byte (b at the end of value), short (s at the end of value), int or String types.

Rewards [Necessary property]

All properties must be represented as String or List of String except exp (it must be represented as integer) and items (it must be represented as List of Items).

  • command - run command as the player who completed the quest. @m will be replaced with the nickname of the player.
  • console - run command as the console. @m will be replaced with the nickname of the player.
  • items - items that will be given to the player.
  • startQuests - add all quests from the list as a quest in progress to the player.
  • addQuests - add all quests from the list as completed to the player.
  • removeQuests - remove all quests from the list as completed or a quest in progress from the player.
  • addDialogs - add all dialogs from the list as read to the player.
  • removeDialogs - remove all dialogs from the list as read from the player.
  • exp - add a given amount of the experience to the player.

Sound

Must be represented as String. This value will be converted to the Minecraft sound and will be played to a player when the quest will be completed.

Template:

{
	"displayName": "I need a diamond...",
	"text": "Thanks for the diamond!",
	"info": "Hover text in /quests",
	"uuid": "{uuid}",
	"conditions": {
		"dialogs": ["4"],
		"items": [
			{
				"id": "diamond",
				"count": 1,
				"nbt": "{CustomModelData:1}",
			}
		]
	},
	"rewards": {
		"console": "say Hi, I'm server!",
		"command": "say Hi, I'm player!",
		"items": [
			{
				"id": "dirt",
				"count": 1,
				"nbt": "{CustomTag:2b}"
			}
		],
		"startQuests": "10",
		"addQuests": ["11", "12"],
		"removeQuests": "13",
		"addDialogs": ["10"],
		"removeDialogs": ["11", "12", "13"],
		"exp": 5
	},
	"sound": "entity.villager.ambient"
}