Home›Java›Mods›ChatDiag
ChatDiag
ModsJava

ChatDiag

Java mod listed for Minecraft 1.21. Downloads from the MC Java Mods app on Android.

by Lau6L · on Modrinth

⬇ Download on Modrinth
ChatDiag — screenshot 1ChatDiag — screenshot 2

This lightweight mod adds structured, timed messages to chat: create monologues with precise WPM timing and line-by-line delivery!

ChatDiag's dialogs can be provided by datapacks, command blocks, player execution, or mod integration. They are specially designed for storytelling in server events and mapmaking.

Dialogs support formatting codes, as well as custom sounds, fonts, and commands.

Executing dialogs

To start rendering a dialog, use the new /chatdiag or /cdiag admin command.

Syntax

Executes a defined dialog by namespace

/chatdiag [players] id [dialog-id]

Example:

/chatdiag @s id example:example_dialog

id dialog usage

Executes a defined dialog by data

/chatdiag [players] data [dialog-object]

Example:

/cdiag @a data {"prefix": "<ChatDiag> ", "lines": ["Hello!", "This dialog was not defined in any file."]}

data dialog usage

Development

Data packs

Data-driven dialogs are defined via namespaced resources. These definitions must reside under the chatdiag/ directory (data/<namespace>/chatdiag/<file>.json, loads as <namespace>:<file>) for mod resources or datapacks.

/reload reloads data-pack dialogs.

Mod integration

ChatDiag provides the ChatDiag.api() integration entrypoint for mods.

Dialogs can be made to keep the same completable future across chained dialogs, so the result only completes once the entire chain is done.

In order to declare a dependency on ChatDiag from your mod, add the following to your build.gradle:

repositories {
    // ...
    maven { url = "https://api.modrinth.com/maven" }
}
dependencies {
    // ...

    // chatdiag_version example for 1.0.0+1.21.11: 7GbCgI5k
    modImplementation "maven.modrinth:chatdiag:${project.chatdiag_version}"
}
Dialog definition

Dialogs

Dialogs consist of a list of Lines, and optional settings that add custom behaviors. These behaviors are:

Dialog lines can be either:

A DialogLine object can replace its parent dialog's behaviors via its replace_prefix, replace_suffix, and replace_sound boolean flags. Moreover, DialogLines can execute commands using their command attribute. This is different from Dialogs' next_command, as command runs when rendering, and next_command runs after the last line's delay has passed.

Sound objects contain a namespaced sound Id, and the following optional attributes:

Dialog definition example
{
  "wpm": "number",

  "sound": {
    "id": "string",
    "pitch": "number"
  },

  "prefix": "string",
  "suffix": "string",

  "lines": [
    "string",

    {
      "line": "string",

      "replace_sound": "boolean",
      "replace_prefix": "boolean",
      "replace_suffix": "boolean",

      "sound": [
        {
          "id": "string",
          "pitch": "number",
          "position": "string"
        },
        {
          "id": "string",
          position: [
            ["number", "number", "number"],
            "string",
            "string"
          ]
        }
      ],

      "prefix": "string",
      "suffix": "string",

      "delay": "number",

      "command": "string"
    }
  ],

  "next_command": "string",
  "next_dialog": "string",
}
Dev Tips

Feel free to use this mod in your modpacks!

Quick facts

Install steps are the general flow for this file type — How to install Minecraft Java mods & modpacks walks through it step by step.

File checked by MCModsHub

These come from our own check of the pack file, not from the source page.

Explore more