Conversation Plugin
> Minecraft plugin for version 1.21.1
For more detailed information, visit the following links:
- HOW TO USE
- INFORMATION
- COMMAND INTERFACE
1. HOW TO USE
The following steps outline the process of setting up and using the conversation plugin on your server:
1. Download the Plugin
- Begin by obtaining the desired version of the plugin.
2. Add to Server Plugins Directory
- Place the downloaded plugin file into the server's `plugins` directory. This is essential for the server to recognize and load the plugin.
3. Initialize the Plugin
- Start your server. The plugin will automatically create a `conversations` directory within the `plugins` folder on the first run. You may also do this manually if you don't want to wait to start the server.
4. Create a Custom Conversation
5. Place the Conversation File
- Move the exported JSON file into the conversations directory. This allows the plugin to access and recognize the conversation file when the server starts or reloads.
6. Start the Server
- Reload or start the server again. The plugin will now load the conversation file, making it available for the players.
7. Manage Players through Commands
- Control and manage players via the Command Interface
2. INFORMATION
Conversations
Conversations are stored in JSON files and consist of nodes. Each node holds one dialogue. With this node-based approach, you can create branching conversations and translate them into Minecraft.
Nodes for Structuring Conversation Flow
Nodes are the fundamental components that structure the conversation flow within the plugin. Each node has its unique identifier and is designed to represent an individual dialogue text within the conversation. There are several types of nodes, each meant to deliver and present specific types of messages, instructions, information, or choices to the player.
These nodes vary in how they present dialogue or information, broadly divided into three main display methods:
- Text in the chat
- Text on the player's screen
- Text embedded within the game world itself
Additionally, each node can contain multiple commands executed at the beginning or the end of the node, with an option for them to be executed after a time delay.
>
Chat Node
The Chat Node sends simple text messages directly to the player's chat. This node does not impose any delay, meaning the player can proceed to the next node instantly after receiving the message, maintaining a smooth conversational pace.
>
Input Node
The Input Node is an interactive node that captures information from the player. When triggered, this node listens for the player’s input in the chat and stores it in a specified variable, which is subsequently saved to the player’s map of variable values in the conversation file. The stored input can then be referenced in later dialogues. Additionally, the Input Node can send a prompt or question to guide the player in providing the desired information. If left empty, no text will appear. The node remains active indefinitely until the player submits a response, thereby pausing the conversation flow until an input is provided.
>
Boss Bar Node
This node displays a message in the player's boss bar at the top of the screen alongside a progress bar. The Boss Bar Node is particularly effective for visually indicating a player's progress in a story, task, or quest, as the fullness of the progress bar can be adjusted to reflect the player's progression. The text and progress bar remains visible for the node's specified duration.
>
Action Bar Node
The Action Bar Node displays text directly above the player’s hot bar, which resides at the lower portion of the screen. This positioning is ideal for presenting brief supplementary text, such as internal thoughts, language subtitles, or off-screen character dialogue. The displayed text persists for the specified duration, after which the Action Bar fades away.
>
Title and Subtitle Nodes
These nodes display text in the center of the player's screen. You can display only the title, only the subtitle, or both at the same time. This node type is well-suited for scene transitions, area introductions, story explanations, internal thoughts, or narrative highlights requiring prominent on-screen messaging. This node is shown for a specified duration, and you can adjust its fade-in and fade-out timer to your liking.
>
Display Node
The Display Node utilizes a text display entity to spawn text directly into the game world. This text can appear at a specific location or be bound to an entity, enabling dynamic movement alongside it. The text lasts for a predetermined duration, after which it disappears.
The unique feature of the Display Node is its ability to transition into cutscenes. With cutscenes, users can set parameters, such as the camera's location, that lie in a radius around the targeted area or entity. Height, position, direction, target focus, and zoom level, among other things, can be adjusted.
>
No Cutscene: The text is displayed at the specified location or bound to an entity, and the player retains the entire body and camera movement control, unaffected by any camera adjustments.
>
Player Mode: The text is displayed at the specified location or bound to an entity in this mode. However, the player's camera is directed towards a selected target, their movement is restricted, and the camera zooms in on the target to capture the player's focus, resulting in a first-person cutscene.
>
Cutscene Mode: This immersive mode displays the text at the specified location or bound to an entity and places the player in the spectator mode, teleports him to a designated area, forces the camera to look at the target, and applies a zoom effect, which results in a third person cutscene. Suppose the
citizens flag is enabled in the
Conversation Settings. In that case, the player's character is replaced by an NPC with the exact location and camera direction before teleporting the player, enhancing authenticity. Additionally, cutscenes can be smoothly chained, where all subsequent Display Nodes in cutscene mode with a
Time Trigger will seamlessly transition, creating a fluid cinematic experience.
>
Choice Node
The Choice Node enables branching narratives by presenting players with multiple interactive options. This node also uses a text display entity to show choices within the game world. The main message of the Choice Node can be positioned at a specified location or attached to an entity, providing means to ask a question or whatever information is needed. This text can also stay empty, and only the choices will be displayed. Each choice within this node is rendered as an interactive text option, residing either at a specified location or attached to an entity, and the plugin calculates the spacing and locations of all choices and evenly places them between the entity/location and the player for more pleasing visual storytelling. Players can choose their preferred path by left-clicking on one of these options, which directs them to the selected branch of the conversation. Choice can have specified requirements. The choice won't be displayed when the player does not possess those requirements, allowing for better conversation flow control. The Choice Node remains active until the player makes a selection.
Trigger Mechanisms for Node Activation
Triggers serve as the primary mechanisms for initiating nodes and orchestrating the flow of a conversation. Several straightforward triggers are predefined within the plugin to support basic functionality.
Time Trigger: This trigger activates a node following a specified time delay. It is beneficial for pacing conversations or introducing a pause before progressing to the following dialogue or action.
Location Trigger: This trigger initiates a node when a player enters a predefined radius around a specified location.
Command Trigger: This trigger offers high flexibility, allowing activation based on specific commands. The Command Trigger can be initiated at any chosen moment, which makes it a valuable tool for customizing conversation flow. This adaptability allows developers to integrate the conversation plugin seamlessly with custom plugins, command blocks, or other in-game mechanics.
In addition to these primary triggers, the system includes other types that respond to fundamental interactions with items, blocks, and entities.
Conversation Tool
You can use the
Conversation Tool command to receive a modified item inside the game. This tool aids developers in incorporating accurate locations and entity identifiers into their conversation structures.
When the player right-clicks on a block while holding this item, the tool will output the precise coordinates of that block into the chat. This feature includes a convenient option for players to copy the displayed coordinates directly.
Similarly, suppose the player right-clicks on an entity using this tool. In that case, that entity's unique identifier (UUID) will be presented in the chat with the option to copy it.
3. COMMAND INTERFACE
The plugin comes with the
/conversation command that is used for managing player conversations, handling conversation flow, and managing player-specific requirements and variables. Commands that don't execute the node will position the player at the node but require a
RUN command to be executed.
Below is an organized breakdown of each command and its purpose.
Conversation Management Commands
Commands to initiate, start, reset, restart, and remove players from conversations.
Initiate Command
> Usage:
/conversation [player] [conversation] initiate
- Adds player to the conversation.
- Does not execute the node.
Start Command
> Usage:
/conversation [player] [conversation] start
- Adds a player to the conversation.
- Does execute the node.
Reset Command
> Usage:
/conversation [player] [conversation] reset
- Restarts the conversation for the player.
- Does not execute the node.
- Uses REMOVE and INITIATE commands.
- Does not save player-specific requirements and variables.
Restart Command
> Usage:
/conversation [player] [conversation] restart
- Restarts the conversation for the player.
- Does execute the node.
- Uses REMOVE and START` commands.
- Does not save player-specific requirements and variables.
Remove Command
> Usage:
/conversation [player] [conversation] remove
- Removes a player from the conversation.
- Does not save player-specific requirements and variables.
Player Management Commands
Commands for setting and managing player-specific requirements and variables.
Add Requirement Command
> Usage:
/conversation [player] [conversation] add requirement [requirement]
- Adds a specified requirement for the player within the conversation.
Add Variable Command
> Usage:
/conversation [player] [conversation] add variable [variable] [value]
- Adds a specified variable with a given value for the player within the conversation.
Clear Requirements Command
> Usage:
/conversation [player] [conversation] clear requirements
- Clears all requirements for the player within the conversation.
Clear Variables Command
> Usage:
/conversation [player] [conversation] clear variables
- Clears all variables for the player within the conversation.
Remove Requirement Command
> Usage:
/conversation [player] [conversation] remove requirement [requirement]
- Removes a specified requirement for the player within the conversation.
Remove Variable Command
> Usage:
/conversation [player] [conversation] remove variable [variable]
- Removes a specified variable for the player within the conversation.
Debugging Commands
Commands to assist in creating, testing, and troubleshooting conversations.
Give Tool Command
> Usage:
/conversation give tool
- Gives the player a conversation tool that provides information on the coordinates of right-clicked blocks or the IDs of right-clicked entities.
Print Node Command
> Usage:
/conversation [player] [conversation] print
- Displays the player's current conversation node.
Print Requirements Command
> Usage:
/conversation [player] [conversation] print requirements
- Displays all requirements for the player within the conversation.
Print Variables Command
> Usage:
/conversation [player] [conversation] print variables
- Displays all variables for the player within the conversation.
Conversation Flow Commands
Commands to control the progress and flow of players through the conversation nodes.
Next Command
> Usage:
/conversation [player] [conversation] next
- Advances player to the next node.
- Does not execute the node.
- Does not ignore node requirements.
Continue Command
> Usage:
/conversation [player] [conversation] continue
- Advances player to the next node.
- Does execute the node.
- Does not ignore node requirements.
Set commands
> Usage:
/conversation [player] [conversation] set [node]
- Moves the player to a specified node.
- Does not execute the node.
- Ignores node requirements.
> Usage:
/conversation [player] [conversation] set next
- Moves the player to a specified node.
- Does not execute the node.
- Ignores node requirements.
Jump Command
> Usage:
/conversation [player] [conversation] jump [node]
- Moves the player to a specified node.
- Does execute the node.
- Ignores node requirements.
> Usage:
/conversation [player] [conversation] jump next
- Moves the player to a specified node.
- Does execute the node.
- Ignores node requirements.
Run Command
> Usage:
/conversation [player] [conversation] run
- Executes the current node of the conversation.
- Does execute the node.