Compatibility
Minecraft: Java Edition
1.21.1
Platforms
Supported environments
Client-side
Tags
Creators
Details
Licensed MIT
Published 2 weeks ago
Updated last week
A two-part system that shows Citizens NPC dialogue in a Pokémon-style text box and makes the NPC walk up to you, on a Minecraft 1.21.1 hybrid (Mohist/Arclight) server running Cobblemon.
Part 1 — Client mod (npc-dialog-box, Fabric)
Installed in the client's mods/ folder. It's purely visual.
- Listens to incoming chat/system messages using Fabric's message events.
- Matches a configurable regex pattern against each line. The default matches your server's NPC speech format <rank> | <Name>: <text> (e.g. ᴅᴏc | Toh: Hello!) and also the rank-less form Name: text, while ignoring normal player chat (which uses the » separator) and plugin broadcasts like [PokeHunt] ….
- When a line matches, it hides it from chat and opens a Pokémon-style box at the bottom of the screen, drawing the original KantoNPCs textures (dialog_box.png, arrow_down.png).
- Typewriter effect: text appears character-by-character.
- Auto-pagination: long text is split into pages of ~2 lines that fit the box; a bouncing arrow shows when there's more. Click / Space / Enter advances; the last click closes it.
- Consecutive lines from the same NPC merge into extra pages of the same box.
- Config file config/npcdialogbox.json: pattern, charsPerTick (typing speed), scale, wrapWidth, linesPerPage, debug.
- Test command: /npcdialogtest <text> opens the box directly.
Part 2 — Server plugin (npc-approach-plugin, Bukkit/Citizens)
Installed in the server's plugins/ folder. It controls NPC behavior (the client can't move server entities).
- Detects the nearest player within a radius, makes the Citizens NPC walk up to them, and when it arrives sends that player the dialogue line (in the [rank] | Name: text format the client mod reads).
- When the player leaves, the NPC walks back to its home spot (teleports back as a fallback), restoring its original facing — mirroring KantoNPCs' behavior.
- Per-NPC setup in-game: select with /npc select, then /npcapproach set <text>, plus add, enable/disable, radius, stop, cooldown, speed, info, clear, reload (with tab-complete).
- Global defaults in config.yml (radius 8, stop 2, cooldown 16s, speed 1.0 — matched to KantoNPCs).


