ParticleDrawing
English | 简体中文
ParticleDrawing 是一个适用于 Minecraft(NeoForge 和 Fabric)的粒子效果库。通过在聊天栏、命令方块或数据包函数中使用 /pdraw 命令,可以绘制形状、动画化粒子组并运行发射器。模组开发者可以使用 Kotlin 和 Java API 构建效果。该模组还播放从 ParticleDrawing 编辑器导出的 .pdrawc 动画。
服务器仅发送一次组动画、生命周期曲线和客户端发射器配置。客户端在本地评估并渲染这些效果。批量生成、速度、力和追踪更新会自动拆分为数据包。
内置的软点和线条无需自定义资源包即可工作,原版粒子纹理也是如此。ParticleDrawing 还支持自定义 PNG 纹理、每个粒子的 UV、独立的宽度和高度、固定方向、加法混合以及动态光照。
安装
| Minecraft |
最低 NeoForge 版本 |
Java |
| 1.21–1.21.11 |
查看版本表 |
21 |
| 26.2 |
26.2.0.59 |
25 |
| 26.3 |
26.3.0.101 |
25 |
- 为你的 Minecraft 版本安装 NeoForge 或 Fabric Loader。Fabric 还需要 Fabric API。
- 将对应你 Minecraft 版本和加载器的 ParticleDrawing JAR 文件放入
mods/ 目录。在多人游戏中,需在服务器和每个客户端上安装相同版本的构建。
- 在游戏中,运行
/pdraw 打开绘图教程。要绘制图形,请在单人游戏中启用作弊,或在服务器上使用具有游戏管理员权限的账号。
从 Modrinth 或 GitHub Releases 下载。
两种加载器均支持上述 Minecraft 版本。有关构建命令和文件名,请参阅 按版本构建。
命令
面向开阔区域并将此命令粘贴到聊天栏中。一个水平圆环会出现于前方四格处、脚踝高度,持续约五秒。
/pdraw draw circle
尝试使用 /pdraw draw circle radius 2 look color red life 200 来创建一个更大的红色圆环,持续十秒。要从函数中运行效果,请参阅 数据包指南。
| 命令 |
描述 |
/pdraw draw … |
使用默认位置、尺寸和生命周期绘制形状。按 Tab 键选择形状。 |
/pdraw particle draw … |
绘制一个或多个形状,命名该组,并追加 then 动作。 |
/pdraw particle emitter … |
设置采样、生成和运动公式、外观及发射时机。 |
/pdraw particle template / use … |
保存发射器声明并使用覆盖参数实例化它。 |
/pdraw particle start / burst / stop … |
开始连续发射、发出单次爆发或停止生成。 |
/pdraw particle clear / delete … |
清除活动实例,或删除指定的发射器、组或模板。 |
/pdraw particle emitter edit <name> … |
编辑现有发射器。 |
/pdraw particle group <name> … |
检查组、添加形状或编排其动作。 |
/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 和 pointset。
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
请参阅 Kotlin 和 Java 快速入门 以获取包含导入的完整方法,并参阅 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
在服务器线程上调用绘图 API,传入 ServerLevel。此示例中的环形效果持续 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 and Fabric. 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.11 |
See the version table |
21 |
| 26.2 |
26.2.0.59 |
25 |
| 26.3 |
26.3.0.101 |
25 |
- Install NeoForge or Fabric Loader for your Minecraft version. Fabric also requires Fabric API.
- Place the ParticleDrawing JAR for your Minecraft version and loader in
mods/. In multiplayer, install the same build on the server and each client.
- In game, run
/pdraw to open the drawing tutorial. To draw, enable cheats in singleplayer or use an account with game master permissions on the server.
Download from Modrinth or GitHub Releases.
Both loaders support the Minecraft versions above. See building by version for build commands and file names.
Commands
Face an open area and paste this command into chat. A horizontal ring appears four blocks ahead at ankle height and lasts about five seconds.
/pdraw draw circle
Try /pdraw draw circle radius 2 look color red life 200 for a larger red ring that lasts ten seconds. To run effects from functions, see the data pack guide.
| Command |
Description |
/pdraw draw … |
Draw a shape with default placement, dimensions and lifetime. Press Tab to choose a shape. |
/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 emitter edit <name> … |
Edit an existing emitter. |
/pdraw particle group <name> … |
Inspect a group, add shapes or choreograph it. |
/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, expr and pointset.
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
See the Kotlin and Java quickstart for complete methods with imports and the API reference for signatures and handle lifetimes.
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
登录后参与评分
还没有评论,来抢沙发吧