跳到正文

Radial Patterns

作者:AmogusAzul

Minecraft datapack library for randomized radial callback patterns

收藏

介绍

中文介绍正在准备中,下面暂时显示原文。

Radial Patterns

Radial Patterns is a small Minecraft Java Edition datapack library for running your own functions across randomized block patterns around an origin.

It does not change blocks, damage entities, or run on tick by itself. Other datapacks call it and provide the functions that should run at each selected position.

Good fits include splashes, bursts, weathering, corrosion, frost, magic effects, mining tools, and other effects that should feel irregular without doing live raycasts.

Compatibility

  • Minecraft: Java Edition 26.2
  • Data pack format: 107
  • License: MIT

Install

Download the release zip and put it in your world’s datapacks folder:

<world>/datapacks/radial-patterns-<version>.zip

Then run:

/reload

Use

Call radial_patterns:apply at the center of your effect and pass one callback function for each layer:

execute positioned <x> <y> <z> run function radial_patterns:apply {outer_func:"example:outer",middle_func:"example:middle",inner_func:"example:inner"}

Each callback runs at the block positions selected for that layer. The layers run in this order:

outer
middle
inner

Coordinates can overlap, so the same position may receive more than one callback execution. This is useful for effects that should become stronger toward the center.

Example

Create a callback:

# data/example/function/puff.mcfunction
particle minecraft:dust{color:[1.0,0.2,0.1],scale:0.8} ~ ~ ~ 0.18 0.18 0.18 0 4 force

Call the library:

execute at @s run function radial_patterns:apply {outer_func:"example:puff",middle_func:"example:puff",inner_func:"example:puff"}

For block-changing effects, keep callbacks cheap and reject irrelevant blocks first:

execute if block ~ ~ ~ #example:affected_blocks run function example:process_block

Shape

The generated patterns use 81 possible relative coordinates:

  • the central 3x3x3 cube;
  • one centered 3x3 face extending from each side of that cube.

This gives a compact radius-two shape without scanning every corner of a full 5x5x5 cube.

Each invocation randomly selects one generated pattern from each layer. The default release includes 8 patterns per layer, for 8 x 8 x 8 = 512 possible layer combinations.

Developer Notes

Repository layout

radial-patterns/
├── data/
│   ├── minecraft/tags/function/load.json
│   ├── radial_patterns/function/apply.mcfunction
│   ├── radial_patterns/function/load.mcfunction
│   ├── radial_patterns/function/dispatch/
│   ├── radial_patterns/function/patterns/
│   └── radial_patterns_test/function/puff.mcfunction
├── tools/generate-patterns.py
├── pack.mcmeta
├── pack.png
├── README.md
└── LICENSE

Regenerate patterns

Pattern and dispatcher files are generated ahead of time:

python3 tools/generate-patterns.py --clean --patterns 8 --seed 365 --manifest build/pattern-manifest.json

The generator validates that every coordinate is inside the canonical 81-coordinate shape and avoids duplicate patterns within each layer.

Export a release zip

From the repository root:

mkdir -p dist
zip -r dist/radial-patterns-1.0.0.zip pack.mcmeta pack.png data -x '*/.DS_Store'

Upload that zip to Modrinth as the datapack file.

Test locally

  1. Copy or symlink the repo into a world’s datapacks folder.
  2. Run /reload.
  3. Run the included particle test:
execute positioned ~ ~ ~ run function radial_patterns:apply {outer_func:"radial_patterns_test:puff",middle_func:"radial_patterns_test:puff",inner_func:"radial_patterns_test:puff"}

Expected behavior: a randomized clustered particle burst appears inside the radius-two shape, and repeated calls vary because each layer selects a random generated pattern.

常见问题

Radial Patterns 支持哪些 Minecraft 版本?

Radial Patterns 支持 Minecraft Java 版 26.2。下载时注意选择和你游戏版本一致的文件。

Radial Patterns 怎么安装?

新建世界时在「数据包」里把下载的 .zip 拖进去;已有的存档,把文件放进存档目录下的 datapacks 文件夹,进游戏输入 /reload 即可生效。服务器同样放在世界目录的 datapacks 里。

评论

登录后评论和评分

AmogusAzul 的其他作品

查看全部 →