CNPCExtended

v1.2.0 MC 1.20.1 / 1.21.1 Forge 47+ Fabric 1.21.1

Extension framework for CustomNPCs. HTML GUIs, HUD overlays, client queries, custom commands, and global content preloading — all from CNPC scripts.


What It Does

CNPCExtended bridges CNPC server-side scripts with real HTML/CSS/JS rendered by MCEF (an embedded Chromium browser inside Minecraft).

See It In Action

How It Works

CNPC Script (Server/GraalJS)         HTML GUI (Client/Chromium)
━━━━━━━━━━━━━━━━━━━━━━━━━━━         ━━━━━━━━━━━━━━━━━━━━━━━━━━

cnpcext.openHtmlGui(e, "gui.html")
    │ reads HTML from world folder
    │ injects bridge JS
    └── packet ──────────────────→   browser renders HTML
                                     window.cnpc.initData ready
                                          │
                                     user clicks a button
                                     window.cnpc.sendEvent("buy",{})
                                          │
htmlGuiEvent(e) ←────────────────── packet to server
    │
    ├─ e.player.giveItem(...)
    ├─ bridge.sendToBrowser(...)
    │       │
    │       └────────────────────→   window.cnpc.onEvent("result",cb)
    │                                updates HTML dynamically
    │
    └─ continues until GUI closes

Requirements

Mod Side Purpose
CustomNPCs Server Script engine + NPC system
MCEF Client Embedded Chromium browser
CNPCExtended Both This mod — bridges CNPC scripts with HTML
New to CNPCExtended? Start with the Quick Start guide.