跳转至

单命令球体生成

本页介绍一个基于执行分叉和旋转向量的球体采样方案。

前置知识

建议先阅读分叉执行

球体命令演示

准备旋转锚点

BP/functions/wiki/sphere/setup.mcfunction
# 召唤两艘船作为旋转锚点
summon boat ~~1~ 0 -90
summon boat ~~1~ 180 90 none
tag @e[type=boat,c=2] add wiki:r

主命令

BP/functions/wiki/sphere/run.mcfunction
execute positioned 0 0 0 rotated as @e[tag=wiki:r] positioned ^1^^ rotated as @e[tag=wiki:r] rotated ~ 0 positioned ^^^1 rotated as @e[tag=wiki:r] positioned ^1.414^^ facing 0 0 0 positioned 0 0 0 positioned ^^^1 rotated as @e[tag=wiki:r] positioned ^1^^ facing 0 0 0 positioned 0 0 0 positioned ^^^1 rotated as @e[tag=wiki:r] positioned ^1^^ facing 0 0 0 positioned 0 0 0 positioned ^^^1 rotated as @e[tag=wiki:r] positioned ^^^1 rotated as @e[tag=wiki:r] positioned ^^^1.414 facing 0 0 0 positioned 0 0 0 positioned ^^^1 rotated as @e[tag=wiki:r] positioned ^^^1 facing 0 0 0 positioned 0 0 0 positioned ^^^1 rotated as @e[tag=wiki:r] positioned ^^^1 facing 0 0 0 positioned as @p run particle minecraft:balloon_gas_particle ^^^3

拆解理解

  1. 横向分叉:positioned ^1^^反复叠加形成近似圆环。
  2. 纵向扩展:positioned ^^^1positioned ^^^1.414把圆环拉成立体壳层。
  3. 回看中心:facing 0 0 0 positioned 0 0 0确保半径方向统一。

分段示意1

分段示意2

分段示意3

分段示意3.1

分段示意4

自定义

  • 改半径:修改最终run^^^3的3。
  • 改密度:增加横向或纵向分叉次数。
  • 改安全性:锚点船请放在常加载、安全区域。