ParticleDrawing
English | 简体中文
ParticleDrawing 是一个用于 NeoForge 版 Minecraft 的粒子效果库。在聊天栏、命令方块或数据包函数中使用 /pdraw 来绘制形状、动画化粒子组以及运行发射器。模组开发者可以使用 Kotlin 和 Java API 构建效果。该模组也支持播放从 ParticleDrawing 编辑器导出的 .pdrawc 动画。
服务器一次性发送组动画、生命周期曲线和客户端发射器配置。客户端在本地评估并渲染这些效果。批量生成、速度、力以及跟踪更新会自动拆分为数据包。
内置的柔点和线条无需自定义资源包即可工作,原版粒子纹理也是如此。ParticleDrawing 还支持自定义 PNG 纹理、每个粒子的 UV、独立的宽度和高度、固定方向、加法混合以及动态光照。
安装
| Minecraft |
最低 NeoForge |
Java |
| 1.21.1 |
21.1.235 |
21 |
| 26.2 |
26.2.0.59 |
25 |
| 26.3 |
26.3.0.101 |
25 |
- 为你的 Minecraft 版本安装 NeoForge。
- 将对应的 ParticleDrawing JAR 放入
mods/ 目录中。在多人游戏中,需要在服务器和每个客户端上安装相同版本的 ParticleDrawing。
- 在游戏中,使用拥有命令权限的账号运行
/pdraw help。
从 Modrinth 或 GitHub Releases 下载。
命令
以下命令绘制一个名为 ring 的环并将其删除。在聊天栏中使用时需加上前缀 /。
pdraw particle draw circle as ring at ~ ~1 ~ radius 3 count 96 look color aqua
pdraw particle delete group ring
| 命令 |
描述 |
/pdraw particle draw … |
绘制一个或多个形状,命名组,并追加 then 动作。 |
/pdraw particle emitter … |
设置采样、生成与运动公式、外观以及发射时机。 |
/pdraw particle template / use … |
保存发射器声明并使用覆盖值实例化它。 |
/pdraw particle start / burst / stop … |
开始连续发射、发射单次爆发或停止生成。 |
/pdraw particle clear / delete … |
清除实时实例,或移除指定名称的发射器、组或模板。 |
/pdraw particle advanced … |
检查配方、编辑实时发射器,或将动作追加到现有组。 |
/pdraw animation … |
列出、播放、停止并检查 .pdrawc 动画。 |
/pdraw camera … |
控制自由相机以进行录制和电影化镜头。 |
/pdraw texture reload |
从磁盘热重载粒子纹理。 |
/pdraw particle field … |
配置粒子力场。 |
组合这些选项以塑造和动画化效果。
draw 接受 dot, field, line, beam, helix, circle, disc, triangle, hexagram,
rect, sphere, cuboid, text, sin 和 expr。
stagger 和 enter fade|grow|fade_grow 用于动画化每个粒子的入场。
then move|spin|delay|recolor|fade_out|follow … 构建组时间线。
look 控制颜色、大小、纹理、发光、混合以及场景感知效果。
emitter 接受 sample, spawn, move, life, rate, window, collide, subemit,
with environment, with probe 和 with on。
按 Tab 键查看可用参数,或运行 /pdraw help cmd draw 或 /pdraw help cmd emitter 获取特定于命令的帮助。粒子命令语法和示例
API
将 Maven Central 添加到你的 Gradle 仓库中,并使用针对你 Minecraft 版本的工件。Kotlin DSL 示例针对 Minecraft 26.3。将 <version> 替换为已发布的 ParticleDrawing 版本。
// build.gradle.kts
dependencies {
compileOnly("work.nekow:particledrawing-neoforge-26.3:<version>")
localRuntime("work.nekow:particledrawing-neoforge-26.3:<version>")
}
# META-INF/neoforge.mods.toml
[[dependencies.${mod_id}]]
modId = "particledrawing"
type = "required"
ordering = "AFTER"
Minecraft 1.21.1 ·
Minecraft 26.2 ·
Minecraft 26.3
在服务端线程上使用 ServerLevel 调用绘图 API。此示例中的环将持续 100 个游戏刻。
import net.minecraft.world.phys.Vec3
import work.nekow.particledrawing.api.Draw
import work.nekow.particledrawing.api.ParticleManager
val manager = ParticleManager.of(level)
Draw.circle(manager, Vec3(0.0, 70.0, 0.0), radius = 3.0, count = 80, lifetime = 100)
Draw 为线条、曲线、折线、多边形、球体、长方体和粒子文本等形状创建 ParticleGroup。
ParticleBatch 管理粒子流,其成员随时间增加和移除。
ParticleManager.emitter(anchor) 创建运行时发射器,按距离或时间间隔生成粒子。
Effects 注册并播放带有可移动锚点和播放控制的命名特效。
Animation.create { … } 使用与 .pdrawc 相同的数据模型在代码中构建动画。
要在你的模组中打包 ParticleDrawing,请使用以下 Gradle 依赖声明。
jarJar(implementation("work.nekow:particledrawing-neoforge-26.3:<version>"))
旧版本发布物使用 work.nekow:particledrawing:<version>。多版本布局与迁移
编辑器回放
编辑器将项目保存为 .pdraw 格式,并导出 .pdrawc 文件以在游戏内回放。动画可以包含时间轴轨道、摄像机轨道、OGG/WAV 音频以及脚本函数对象。
- 从 ParticleDrawing 编辑器 导出
.pdrawc 文件。
- 将该文件放入游戏目录或专用服务器工作目录下的
animations/ 文件夹中。
- 在聊天栏中运行
/pdraw animation play meteor 即可播放 meteor.pdrawc。
文件按需加载,因此你可以在游戏运行时添加或替换它们。运行 /pdraw animation list 列出动画,或运行 /pdraw animation stop 停止当前维度中的动画。
使用 /pdraw animation var <name> <value> 更新脚本变量,使用 /pdraw animation debug 检查回放状态,或在单人游戏中使用 /pdraw animation camera <name> 预览摄像机轨道。通过代码,可以使用 ServerAnimationManager 播放动画、更新变量或停止回放。动画回放
文档
从源代码构建
git clone https://github.com/NekoWs/ParticleDrawing.git
cd ParticleDrawing
./gradlew build # 编译并运行测试套件
./gradlew runClient # 启动开发客户端
./gradlew runServer # 启动开发服务器
根目录构建目标为 Minecraft 26.3,并要求 JDK 25。使用
./gradlew -p platforms/neoforge-26.2 build 或 ./gradlew -p platforms/neoforge-26.3 build
构建特定的 26.x 目标。Minecraft 1.21.1 目标
(./gradlew -p platforms/neoforge-1.21.1 build)和独立核心模块
(./gradlew -p shared/core build)目标 Java 21。
发布
在 gradle.properties 中设置 mod_version,并对同一提交打上 v<mod_version> 标签。推送标签会触发 Maven Central 发布(publish.yml)、Modrinth 发布(modrinth.yml)以及 GitHub Release(release.yml)。每个发布工作流都会检查标签是否与 mod_version 匹配。
要为现有标签发布 GitHub Release,请打开 Actions → Publish GitHub Release → Run workflow
并输入 v<version>。该工作流使用内置的 GITHUB_TOKEN 并具有 contents: write 权限。
重新运行它将替换同名附件并保留发布说明。
许可证
根据 Apache License 2.0 授权。
ParticleDrawing
English | 简体中文
ParticleDrawing is a particle effects library for Minecraft on NeoForge. Use /pdraw in chat, command
blocks, or data pack functions to draw shapes, animate particle groups, and run emitters. Mod
developers can build effects with the Kotlin and Java API. The mod also plays .pdrawc animations
exported from the ParticleDrawing editor.
The server sends group animations, lifetime curves, and client-side emitter configurations once.
Clients evaluate and render those effects locally. Bulk spawn, velocity, force, and
tracking updates are split into packets automatically.
Built-in soft dots and lines work without a custom resource pack, as do vanilla particle textures.
ParticleDrawing also supports custom PNG textures, per-particle UVs, independent width and height, fixed
orientation, additive blending, and dynamic lighting.
Installation
| Minecraft |
Minimum NeoForge |
Java |
| 1.21.1 |
21.1.235 |
21 |
| 26.2 |
26.2.0.59 |
25 |
| 26.3 |
26.3.0.101 |
25 |
- Install NeoForge for your Minecraft version.
- Place the matching ParticleDrawing JAR in
mods/. In multiplayer, install the same ParticleDrawing
version on the server and each client.
- In game, run
/pdraw help with an account that has command permissions.
Download from Modrinth or GitHub Releases.
Commands
The commands below draw a named ring and delete it. In chat, add a leading /.
pdraw particle draw circle as ring at ~ ~1 ~ radius 3 count 96 look color aqua
pdraw particle delete group ring
| Command |
Description |
/pdraw particle draw … |
Draw one or more shapes, name the group, and append then actions. |
/pdraw particle emitter … |
Set sampling, spawn and motion formulas, appearance, and emission timing. |
/pdraw particle template / use … |
Save an emitter declaration and instantiate it with overrides. |
/pdraw particle start / burst / stop … |
Start continuous emission, emit a single burst, or stop spawning. |
/pdraw particle clear / delete … |
Clear live instances, or remove the named emitter, group or template. |
/pdraw particle advanced … |
Inspect recipes, edit live emitters, or append actions to an existing group. |
/pdraw animation … |
List, play, stop, and inspect .pdrawc animations. |
/pdraw camera … |
Control a free camera for recordings and cinematics. |
/pdraw texture reload |
Hot-reload particle textures from disk. |
/pdraw particle field … |
Configure particle force fields. |
Combine these options to shape and animate an effect.
draw accepts dot, field, line, beam, helix, circle, disc, triangle, hexagram,
rect, sphere, cuboid, text, sin and expr.
stagger and enter fade|grow|fade_grow animate each particle's entrance.
then move|spin|delay|recolor|fade_out|follow … builds a group timeline.
look controls color, size, texture, glow, blending and scene-aware effects.
emitter accepts sample, spawn, move, life, rate, window, collide, subemit,
with environment, with probe and with on.
Press Tab for available arguments, or run /pdraw help cmd draw or /pdraw help cmd emitter
for command-specific help. Particle command syntax and examples
API
Add Maven Central to your Gradle repositories and use the artifact for your Minecraft version.
The Kotlin DSL example targets Minecraft 26.3. Replace <version> with a published ParticleDrawing version.
// build.gradle.kts
dependencies {
compileOnly("work.nekow:particledrawing-neoforge-26.3:<version>")
localRuntime("work.nekow:particledrawing-neoforge-26.3:<version>")
}
# META-INF/neoforge.mods.toml
[[dependencies.${mod_id}]]
modId = "particledrawing"
type = "required"
ordering = "AFTER"
Minecraft 1.21.1 ·
Minecraft 26.2 ·
Minecraft 26.3
Call the drawing API on the server thread with a ServerLevel. The ring in this example lasts 100 game ticks.
import net.minecraft.world.phys.Vec3
import work.nekow.particledrawing.api.Draw
import work.nekow.particledrawing.api.ParticleManager
val manager = ParticleManager.of(level)
Draw.circle(manager, Vec3(0.0, 70.0, 0.0), radius = 3.0, count = 80, lifetime = 100)
Draw creates a ParticleGroup for shapes such as lines, curves, polylines, polygons, spheres,
cuboids, and text made of particles.
ParticleBatch manages particle streams whose members are added and removed over time.
ParticleManager.emitter(anchor) creates runtime emitters that spawn by distance or time interval.
Effects registers and plays named effects with movable anchors and playback controls.
Animation.create { … } builds an animation in code using the same data model as .pdrawc.
To bundle ParticleDrawing in your mod, use the following Gradle dependency declaration.
jarJar(implementation("work.nekow:particledrawing-neoforge-26.3:<version>"))
Older releases use work.nekow:particledrawing:<version>. Multi-version layout and migration
Editor playback
The editor saves projects as .pdraw and exports .pdrawc files for in-game playback. Animations can
include timeline tracks, camera tracks, OGG/WAV audio, and scripted function objects.
- Export a
.pdrawc file from the ParticleDrawing editor.
- Put the file in
animations/ under the game directory or the dedicated server's working directory.
- In chat, run
/pdraw animation play meteor to play meteor.pdrawc.
Files are loaded on demand, so you can add or replace them while the game is running. Run
/pdraw animation list to list animations or /pdraw animation stop to stop them in the current dimension.
Use /pdraw animation var <name> <value> to update a script variable, /pdraw animation debug to check
playback status, or /pdraw animation camera <name> to preview a camera track in single-player.
From code, use ServerAnimationManager to play an animation,
update variables, or stop playback. Animation playback
Documentation
Building from source
git clone https://github.com/NekoWs/ParticleDrawing.git
cd ParticleDrawing
./gradlew build # compile and run the test suite
./gradlew runClient # start a development client
./gradlew runServer # start a development server
The root build targets Minecraft 26.3 and requires JDK 25. Use
./gradlew -p platforms/neoforge-26.2 build or ./gradlew -p platforms/neoforge-26.3 build
to build a specific 26.x target. The Minecraft 1.21.1 target
(./gradlew -p platforms/neoforge-1.21.1 build) and the standalone core
(./gradlew -p shared/core build) target Java 21.
Releasing
Set mod_version in gradle.properties and tag the same commit v<mod_version>. Pushing the tag
triggers Maven Central publication (publish.yml), Modrinth publication (modrinth.yml), and the
GitHub Release (release.yml). Each release workflow checks that the tag matches mod_version.
To publish a GitHub Release for an existing tag, open Actions → Publish GitHub Release → Run workflow
and enter v<version>. The workflow uses the built-in GITHUB_TOKEN with contents: write.
Rerunning it replaces same-named attachments and preserves the release notes.
License
Licensed under the Apache License 2.0.
评论 0
登录后参与评分
还没有评论,来抢沙发吧