Minecraft(我的世界)中文论坛

标题: 【2D】用盔甲架绘制一个圆(降维打击)

作者: (=°ω°)丿    时间: 2019-2-1 15:28
标题: 【2D】用盔甲架绘制一个圆(降维打击)
本帖最后由 Teenager_Yang 于 2019-2-1 19:27 编辑

在xOz平面内有任意两个盔甲架:
盔甲架1:无重力,坐标:(x1,0,z1),tag=armor_stand_1
盔甲架2:无重力,坐标:(x2,0,z2),tag=armor_stand_2
目的是以盔甲架1为圆心,盔甲架2为圆上一点,在xOz平面内用盔甲架(无重力,tag=point)绘制一个实心圆(圆上以及圆内每格一个盔甲架)。
某 dalao 是这么说的:
从 armor_stand_1 出发,递归到 armor_stand_2 一直生成 point 连出一条半径,然后旋转 armor_stand_1 一圈并一直 tp 那条半径画出一个圆。

请问:“ 旋转 armor_stand_1 一圈并一直 tp 那条半径画出一个圆 ” 是怎么做的?(不用给出具体的命令)
一下子,难度降了好多……
召唤 dalao:
@SPGoding  
哪位daolao如果缺金粒的话和我说一声,
下次发帖的时候我会@一下的
我的问题会非常简单(确信)
———————— 分割线 ————————
dalao 别走啊……
空心圆也可以啊……
@SPGoding

作者: chyx    时间: 2019-2-1 15:28
做好了 一共5个函数
我懒得打那么长的tag  直接就是给他们tag叫1和2 了最后每个格子里都会有一个tag叫hhh的药水云
游戏里用一下
/function chyx:tri
来画圆
压缩成了一个压缩包
data.zip (1.87 KB, 下载次数: 13)


作者: chyx    时间: 2019-2-2 01:48

这个是效果 exe了药水云放了铁块 你看看效果行不行233是铁块的个数

啊 对了 用之前建立两个dummy记分板 名字叫a和b
我上面没放。
下面是函数的内容

tri
  1. execute as @e[tag=1] store result score @s a run data get entity @s Pos[0] 1.0
  2. execute as @e[tag=2] store result score @s a run data get entity @s Pos[0] 1.0
  3. scoreboard players operation @e[tag=1] a -= @e[tag=2] a
  4. scoreboard players operation @e[tag=1] a *= @e[tag=1] a
  5. execute as @e[tag=1] store result score @s b run data get entity @s Pos[2] 1.0
  6. execute as @e[tag=2] store result score @s b run data get entity @s Pos[2] 1.0
  7. scoreboard players operation @e[tag=1] b -= @e[tag=2] b
  8. scoreboard players operation @e[tag=1] b *= @e[tag=1] b

  9. scoreboard players operation @e[tag=1] a += @e[tag=1] b

  10. execute at @e[tag=1] run summon area_effect_cloud ~ ~ ~ {Tags:["x"]}
  11. execute at @e[tag=1] run summon area_effect_cloud ~ ~ ~ {Tags:["x_"]}
  12. scoreboard players set @e[tag=x] a 0
  13. scoreboard players set @e[tag=x] b 0
  14. function chyx:tri1
复制代码


tri1
  1. execute if score @e[tag=x,limit=1] a <= @e[tag=1,limit=1] a run function chyx:tri1_
复制代码
tri1_

  1. execute at @e[tag=x] run summon area_effect_cloud ~ ~ ~ {Tags:[xa,n,i]}
  2. execute at @e[tag=x] run summon area_effect_cloud ~ ~ ~ {Tags:[xb,n]}
  3. execute if score @e[tag=x,limit=1] a matches 1.. at @e[tag=x_] run summon area_effect_cloud ~ ~ ~ {Tags:[xa,n]}
  4. execute if score @e[tag=x,limit=1] a matches 1.. at @e[tag=x_] run summon area_effect_cloud ~ ~ ~ {Tags:[xb,n]}
  5. scoreboard players set @e[tag=xa] a 0
  6. scoreboard players set @e[tag=xb] b 0
  7. scoreboard players set @e[tag=xa] b 0
  8. scoreboard players set @e[tag=xb] a 0
  9. function chyx:tri2
  10. kill @e[tag=n]

  11. execute as @e[tag=x] at @s run tp ~1 ~ ~
  12. execute as @e[tag=x_] at @s run tp ~-1 ~ ~
  13. scoreboard players add @e[tag=x] b 1
  14. scoreboard players operation @e[tag=x] a = @e[tag=x] b
  15. scoreboard players operation @e[tag=x] a *= @e[tag=x] a

  16. function chyx:tri1
复制代码
tri2
  1. execute if score @e[tag=xa,tag=i,limit=1] a <= @e[tag=1,limit=1] a run function chyx:tri2_
复制代码


tri2_


  1. execute at @e[tag=xa,tag=n] run summon area_effect_cloud ~ ~ ~ {Tags:[hhh]}

  2. execute if score @e[tag=xa,tag=n,tag=i,limit=1] a matches 1.. at @e[tag=xb] run summon area_effect_cloud ~ ~ ~ {Tags:[hhh]}




  3. execute as @e[tag=xa,tag=n] at @s run tp ~ ~ ~1
  4. execute as @e[tag=xb,tag=n] at @s run tp ~ ~ ~-1
  5. scoreboard players add @e[tag=i,tag=xa,tag=n] b 1
  6. scoreboard players operation @e[tag=i,tag=xa,tag=n] a = @e[tag=i,tag=xa,tag=n] b
  7. scoreboard players operation @e[tag=i,tag=xa,tag=n] a *= @e[tag=i,tag=xa,tag=n] a
  8. scoreboard players operation @e[tag=i,tag=xa,tag=n] a += @e[tag=x] a
  9. function chyx:tri2
复制代码