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).
- Open HTML GUIs from any CNPC script (NPC, Player, Block, Item)
- HTML Overlays — render HTML on the HUD layer (skill bars, HP bars, quest trackers) without blocking input
- Cutscene System — keyframe-based camera cutscenes with visual editor, fade transitions, and script phase events
- Hide vanilla HUD — selectively hide hotbar, health, food, XP, crosshair, chat, etc.
- Bidirectional events — HTML sends events to the server, server pushes data back
- Real MC item overlays — render actual
ItemStackwith enchant glint, durability bars, tooltips on top of HTML - Query client settings — read FOV, render distance, keybinds, sound volumes, resource packs
- Custom commands — register runtime commands from scripts
- Global preloading — auto-deploy scripts + NPC data into new worlds
- Target any player — open GUIs/overlays on other players, not just the one who triggered the script
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.