Tags
Creators
Details
Licensed MIT
Published 2 months ago
Updated yesterday
All versions
2.6.2
Release
VFXWeaver API 2.6.2 (26.2, NeoForge)2 days ago 3
Compatibility
Minecraft: Java Edition
26.2
Platform
NeoForge
Supported environments
Client-side
Client and server
Changes
Added
- The Java API can create, replace and remove a mask at runtime.
VFXAPI.sendMask(ServerPlayer, Identifier, @Nullable String maskJson)(and the client-localVFXAPI.mask(Identifier, String)) override the mask a definition authored - no datapack edit, no restart. The JSON is the full datapack mask object, parsed by the sameVFXMaskParser, so every leaf family (screencircle/ellipse/rect/polygon, worldsphere/box,block,block_list,sky,depth, a registered custom shape), every composition (union/intersection/difference, left-nested),invert,fill,softness, the numeric leaf fields,bind/field/volumeand a custom leaf'sparams/datacan be expressed. Graphfromis authored-only: a{ "from": "<node>" }slot resolves against the definition's graph, which a runtime mask does not have, so a JSON containing one is rejected with one warning (never rendered with the slot default) and the current mask stays; animate a runtime mask withsendMaskMove/sendMaskData/sendSetParam/sendSetParamExprinstead.VFXMaskSpec(indev.vfxweaver.mask) builds that object in code -circle,ellipse,rect,polygon,sky,depth,sphere,box,block,blockTag,blockList,blockRegion,custom(shapeId, space[, params...]),center,space,rotation,softness,fill,strokeWidth,invertandunion/intersection/difference- andbuildJson()returns the exact mask object after validating the combination the parser would reject (hollowonly on ablock_list,strokeneeds a width, at least 3 polygon sides, a block scan radius withinVFXMaskBlockSelection.MAX_RADIUS= 32 blocks, at mostMAX_LEAF_PARAMS= 8 custom params, at mostVFXCustomShape.MAX_CUSTOM_LEAVES= 2 custom leaves, at mostVFXMaskBlockSelection.MAX_BLOCKS= 512 block ids with no blank id/tag, ablockRegionvolume withinMAX_REGION_BLOCKS= 65536 blocks (floored corners, like the parser), aspaceits family supports, acenterwith the arity that space defines, left-nesting only - a right-nested operand is refused with the fix in the message - and the parser'sMAX_COMPOSITION_DEPTH(8) andMAX_PRIMITIVES(8) budgets).custom(...)takes the space explicitly, because the shape registry is client-local: a spec built on a server cannot look it up and must not guess a centre/params arity the client would reject. Both API calls take a spec overload. The override is scoped per effect id: masks are authored per definition and their coverage targets are shared per definition, so it applies to every running instance of that effect for that player and is remembered for future plays of the same id. Anullor blank JSON removes the override and restores the authored mask; invalid JSON is rejected with one warning (from the mask manager alone - the packet handler adds no second line) and leaves the current mask untouched, and an over-long JSON (aboveVFXTriggerPayload.MAX_MASK_JSON) is refused by the API (false, one warning) instead of being sent asnull, becausenullmeans "remove the override". On the client the mask lives onVFXActiveEffectas a nullable runtime mask plus anoverriddenflag (getMask()prefers the override, removal falls back to the authored mask, and the uniform writer reads the override's own slot values so the authored mask's animated params do not leak into it);VFXPostProcessingManagercompares mask identity per definition id, so a changed mask rebuilds that effect's coverage target and block-geometry scratch; every override is dropped when the client leaves a server, next to the scoreboard cache reset, so one session's mask never leaks into the next.sendMaskMove/sendMaskDataare unchanged and keep driving a runtime mask live. This is a wire change:VFXAction.SET_MASK(id 6), a new optional trailingmaskJsononVFXTriggerPayload, andPROTOCOL_VERSION8 -> 9 - an older client drops the whole packet on the mismatch. Documented in API.md. The pixels cannot be verified headless here. Not verified in game.
Projects on Modrinth are automatically available through a Maven repository for use with JVM build tools such as Gradle. To learn more about the Modrinth Maven API, click here.
Note: When available, you should use the creator's maven repo instead as it will have transitive dependency information that the Modrinth Maven API does not. You may also end up with duplicate dependencies if you use a mix of Modrinth and non-Modrinth Maven repositories for your dependencies, because the group identifier will be different when served through the Modrinth Maven API.
Maven coordinates:
Version ID:
build.gradle:
repositories {
exclusiveContent {
forRepository {
maven {
name = "Modrinth"
url = "https://api.modrinth.com/maven"
}
}
// forRepositories(fg.repository) // Uncomment when using ForgeGradle
filter {
includeGroup "maven.modrinth"
}
}
}
// Standard Gradle dependency
dependencies {
implementation "maven.modrinth:HBhB8m4j:Yy2xkvDg"
}
// Legacy Loom dependency
dependencies {
modImplementation "maven.modrinth:HBhB8m4j:Yy2xkvDg"
}

