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
- execute as @e[tag=1] store result score @s a run data get entity @s Pos[0] 1.0
- execute as @e[tag=2] store result score @s a run data get entity @s Pos[0] 1.0
- scoreboard players operation @e[tag=1] a -= @e[tag=2] a
- scoreboard players operation @e[tag=1] a *= @e[tag=1] a
- execute as @e[tag=1] store result score @s b run data get entity @s Pos[2] 1.0
- execute as @e[tag=2] store result score @s b run data get entity @s Pos[2] 1.0
- scoreboard players operation @e[tag=1] b -= @e[tag=2] b
- scoreboard players operation @e[tag=1] b *= @e[tag=1] b
- scoreboard players operation @e[tag=1] a += @e[tag=1] b
- execute at @e[tag=1] run summon area_effect_cloud ~ ~ ~ {Tags:["x"]}
- execute at @e[tag=1] run summon area_effect_cloud ~ ~ ~ {Tags:["x_"]}
- scoreboard players set @e[tag=x] a 0
- scoreboard players set @e[tag=x] b 0
- function chyx:tri1
复制代码
tri1
- execute if score @e[tag=x,limit=1] a <= @e[tag=1,limit=1] a run function chyx:tri1_
复制代码 tri1_
- execute at @e[tag=x] run summon area_effect_cloud ~ ~ ~ {Tags:[xa,n,i]}
- execute at @e[tag=x] run summon area_effect_cloud ~ ~ ~ {Tags:[xb,n]}
- execute if score @e[tag=x,limit=1] a matches 1.. at @e[tag=x_] run summon area_effect_cloud ~ ~ ~ {Tags:[xa,n]}
- execute if score @e[tag=x,limit=1] a matches 1.. at @e[tag=x_] run summon area_effect_cloud ~ ~ ~ {Tags:[xb,n]}
- scoreboard players set @e[tag=xa] a 0
- scoreboard players set @e[tag=xb] b 0
- scoreboard players set @e[tag=xa] b 0
- scoreboard players set @e[tag=xb] a 0
- function chyx:tri2
- kill @e[tag=n]
- execute as @e[tag=x] at @s run tp ~1 ~ ~
- execute as @e[tag=x_] at @s run tp ~-1 ~ ~
- scoreboard players add @e[tag=x] b 1
- scoreboard players operation @e[tag=x] a = @e[tag=x] b
- scoreboard players operation @e[tag=x] a *= @e[tag=x] a
- function chyx:tri1
复制代码 tri2
- execute if score @e[tag=xa,tag=i,limit=1] a <= @e[tag=1,limit=1] a run function chyx:tri2_
复制代码
tri2_
- execute at @e[tag=xa,tag=n] run summon area_effect_cloud ~ ~ ~ {Tags:[hhh]}
- 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]}
- execute as @e[tag=xa,tag=n] at @s run tp ~ ~ ~1
- execute as @e[tag=xb,tag=n] at @s run tp ~ ~ ~-1
- scoreboard players add @e[tag=i,tag=xa,tag=n] b 1
- scoreboard players operation @e[tag=i,tag=xa,tag=n] a = @e[tag=i,tag=xa,tag=n] b
- scoreboard players operation @e[tag=i,tag=xa,tag=n] a *= @e[tag=i,tag=xa,tag=n] a
- scoreboard players operation @e[tag=i,tag=xa,tag=n] a += @e[tag=x] a
- function chyx:tri2
复制代码