HexJS
by Nanorasmus
HexJS gives server owners and modpack authors a KubeJS scripting layer for Hex Casting, covering custom patterns, scrolls, casting and list-based limits.
What it does
HexJS connects Hex Casting to KubeJS, so scripts can register new patterns, set per-player and global whitelists or blacklists for patterns, redirect a pattern to another, and cast spells on a player's behalf. Both Hex Casting and KubeJS are required dependencies and must be installed alongside HexJS. The mod runs on the server only, so players join without installing anything.
Custom patterns are registered in two steps: a script first registers a pattern under a name and checks its question, then handles the cast through a registered pattern cast event. A pattern can also override an existing one. Scripts can create ancient scrolls and attach pre-imbued spells to cyphers, trinkets, artifacts and loot chests, and they can set the maximum length for Bookkeeper's Gambit.
HexJS is published for Fabric, Forge and Quilt, with files covering 1.19.2 – 1.19.4 and the latest builds released on 2024-07-29. The code is open source under the MIT License, with a public source repository and issue tracker.
Key features
Custom patterns
Scripts register new spell patterns with names and handlers, and can override patterns that already exist in Hex Casting.
Lists and redirects
Global and per-player whitelists and blacklists control which patterns are allowed, and redirects swap one drawn pattern for another.
Pre-imbued items and scrolls
Cyphers, trinkets, artifacts and ancient scrolls can be created with pre-imbued spells and media, including through loot chests and mob drops.
Forced casting
A script can make a player cast a list of patterns, and it can use fake players through CarpetMod to cast spells.
Compatibility
Latest build for each game version and loader.
Only full game releases are shown. This mod publishes no snapshot builds.
Requirements
Dependencies declared by the latest file for each loader.
Required 2
Use cases
Modpack spell content
Authors add custom patterns and scrolls to a pack, then restrict or redirect patterns with server-side lists.
Who it’s for: Server owners and modpack authors who script Hex Casting with KubeJS. The mod does nothing for a player who only uses Hex Casting without a script.
Questions
Does HexJS need Hex Casting and KubeJS?
Does HexJS have to be installed on the client?
Which loaders does HexJS support?
More from Nanorasmus
What the author says
The per-player lists are persistent, while the global list is not. If there is a conflict, the per-player list takes priority. Tip: Blocking the base number literal (0) for either positive or negative numbers will block all numbers of that type ### Redirects The server and each player has their own list of redirects…
Official listing
- Modrinth page
- modrinth.com/mod/hexjs
- Owner
- Nanorasmus
- Published
- 2024-07-22
- Updated on Modrinth
- 2024-07-29
- Facts verified
- 2026-10-15
