
HexJSNeo
Adding game contents via KubeJS for base mod Hex Casting, including pattern actions, special handlers, iota types, and more.
Автор: YukkuriC1641обновлён 1 нояб. 2026 г.
ПроклятыеБиблиотекиМагия
Описание
HexJSNeo
Provides a way to create custom contents for Hex Casting via KubeJS.
Features
Core Concepts
- Minimal efforts: auto registered great pattern tags, omit all optional args, pipe everything, ...
- Weak typed:
ActionJSreturns,ActionRegistryJS.of, etc. - Mutable is best: no registration event and phase limit, writing and reloading everywhere in startup scripts, we're writing JS \yay/
- Clean global scope: everything under a single
HexJSglobal object, no leaks
Game Content Registry
ActionJS: basis for all executables- customizable
operate&operateInParens, with high degree-of-freedom return value handling - additional helper methods for creating
operatevarieties - assigning
mediaCostto auto-attach media-cost side effect on operate, withpreCheckMediamethods to help check & mishap before logics
- customizable
ActionRegistryJS: registering certain patterns with actions- = Registry ID + Pattern prototype + inner
ActionJS+ Great-pattern marker (default false) - weak-typed constructor
ActionRegistryJS.of(...): args in any order among its constructor, missing ones auto-filled (id from pattern signature, freshActionJS,false); only the pattern is required - transparent proxy of inner
ActionJS: operate setters (setOperate& variants),mediaCostandpreCheckMediaare callable directly on the registry object - great spells are auto-tagged with per-world / enlightenment tags
- = Registry ID + Pattern prototype + inner
SpecialHandlerJS: taking an arbitrary pattern and retrieving its meanings- registers a JS
tryMatch(pattern, env)factory consulted for every drawn pattern SpecialHandlerJS.create(action, name)to help build aSpecialHandler, in whichactioncould be another specially createdActionJS- chain setter
setTryMatchfor KJS-ish usage
- registers a JS
IotaJS: highly customizable iota types- NBT-backed custom iotas:
IotaJS.type(id)creates the type, containingCompoundTagiota data - overriding common iota interfaces (display, color, size, etc.) with either callbacks or constants
- optional executability via
setOperate, controlling its execution behaviors outside and inside parens
- NBT-backed custom iotas:
ArgsJS: basically a forwarder for various built-in Kotlin extension functions- used on a mutable iota list manually, or called from
ActionJS.setOperateArgsSplit - typed getters (
double,vec3,entity, ...) with auto mishaps on missing args or wrong types
- used on a mutable iota list manually, or called from
CastingEnvironmentComponentJS: vanilla but in JS, with more convenient Key creation- each component takes a key string as the first constructor arg, from which the
Keyis auto-created & cached (setKeyto change it later) - usages and types same as vanilla
- each component takes a key string as the first constructor arg, from which the
MishapJS: highly customizable mishap types- declaring the type using
MishapJS.type()first, quite similar toIotaJS - calling
type.create()ortype.create(data)for a mishap of this type - KJS-ish piped methods to override all behaviors of created mishaps
- declaring the type using
ArithmeticJSandOperatorJS: custom arithmetic holders and their pattern operators- declarative operators with iota-type predicates (
Accepts) and piped operate setters, either raw or args-split - bind operators to builtin or custom patterns, with the engine auto-invalidated on script reload
- declarative operators with iota-type predicates (
QoL Features
- Hot-swap everything
- everything, simple as
/kjs reload startup-scripts - covers: actions (entry action & prototype replaced in-place), special handlers, iota types, arithmetics (including their operators)
- not for those haven't created on startup, but it's possible to match later-created pattern actions using a SPECIAL handler :3
CastingEnvironmentComponentJSandMishapJSare born temporary and not covered here
- everything, simple as
- API & packages importer:
HexJS.API&HexJS.APIFlat- exposes all Hex Casting classes scanned from the mod jar, either nested by package (
HexJS.API.<...package>.<Class>) or flat (HexJS.APIFlat)
- exposes all Hex Casting classes scanned from the mod jar, either nested by package (
ProbeJS Typing Support
- generates typings for the JS-facing API, including nested
HexJS.APIlevels, fake-singleton classes flattened to static fields, and subclass members assigned onto their parents
Последние версии
Все версии →alpha
HexJSNeo-neoforge-1.21.1-0.1.2.1.pre64
1.21.1-0.1.2.1.pre641 нояб. 2026 г.11Minecraft: 1.21.1neoforge
Что нового
- more complete ProbeJS support for `ArithmeticJS`
- `IotaJS` coloring overhaul
- auto-convert overflowed JS inputs
- bugfix: default IotaJS type color is no more transparent
> updated with **Pre 64** [latest official 1.21 alpha](https://ci.blamejared.com/job/petrakat/job/Hexcasting/job/1.21/); see [this discord announcement](https://discord.com/channels/936370934292549712/940747174982078564/1512583279868645428) for more information
alpha
HexJSNeo-neoforge-1.21.1-0.1.2.pre64
1.21.1-0.1.2.pre6431 окт. 2026 г.13Minecraft: 1.21.1neoforge
Что нового
# v0.1.2
Added `ArithmeticJS` & `OperatorJS` for custom operator overloads
> updated with **Pre 64** [latest official 1.21 alpha](https://ci.blamejared.com/job/petrakat/job/Hexcasting/job/1.21/); see [this discord announcement](https://discord.com/channels/936370934292549712/940747174982078564/1512583279868645428) for more information
alpha
HexJSNeo-neoforge-1.21.1-0.1.2.pre64
1.21.1-0.1.2.pre6431 окт. 2026 г.7Minecraft: 1.21.1neoforge
Что нового
# v0.1.2
Added `ArithmeticJS` & `OperatorJS` for custom operator overloads
> updated with **Pre 64** [latest official 1.21 alpha](https://ci.blamejared.com/job/petrakat/job/Hexcasting/job/1.21/); see [this discord announcement](https://discord.com/channels/936370934292549712/940747174982078564/1512583279868645428) for more information
alpha
HexJSNeo-neoforge-1.21.1-0.1.1.pre64
1.21.1-0.1.1.pre6415 окт. 2026 г.70Minecraft: 1.21.1neoforge
Что нового
followed yet another breaking change
> updated with **Pre 64** [latest official 1.21 alpha](https://ci.blamejared.com/job/petrakat/job/Hexcasting/job/1.21/); see [this discord announcement](https://discord.com/channels/936370934292549712/940747174982078564/1512583279868645428) for more information
alpha
HexJSNeo-neoforge-1.21.1-0.1.1.pre53
1.21.1-0.1.1.pre536 сент. 2026 г.18Minecraft: 1.21.1neoforge
Что нового
# Pre 53
upgrade all pattern-related stuff
> updated with **Pre 53** [latest official 1.21 alpha](https://ci.blamejared.com/job/petrakat/job/Hexcasting/job/1.21/); see [this discord announcement](https://discord.com/channels/936370934292549712/940747174982078564/1512583279868645428) for more information
alpha
HexJSNeo-neoforge-1.21.1-0.1.1
1.21.1-0.1.15 сент. 2026 г.20Minecraft: 1.21.1neoforge
Что нового
# v0.1.1
introducing `MishapJS`
alpha
HexJSNeo-neoforge-1.21.1-0.1.0
1.21.1-0.1.05 сент. 2026 г.23Minecraft: 1.21.1neoforge
Что нового
init commit