hrminecraft
版本1.13
抛物线我想用summon+算motion
圆环我只会穷举,希望能提供更好的算法
螺旋前进我准备用一支隐形箭,在箭的周围穷举用两个particle围绕箭转,但太复杂了,希望大佬帮忙,提供一个简便点的方法

纱夜
计算三角函数值并画极坐标曲线
https://www.mcbbs.net/thread-622398-1-1.html
(出处: Minecraft(我的世界)中文论坛)

如何在 Minecraft 中计算反三角函数?
https://www.mcbbs.net/thread-871637-1-1.html
(出处: Minecraft(我的世界)中文论坛)


大概可以用三角函数?

Chelover_C60
本帖最后由 CHElover_C60 于 2019-8-9 17:56 编辑

圆和螺旋前进可以考虑局部坐标,抛物线可能稍麻烦,不知道有没有人有更好的方法

圆可以用函数递归
建立计分板
  1. scoreboard objectives add circlr dummy
复制代码
生成圆时,执行以下命令
  1. summon armor_stand ~ ~ ~ {Tags:["ciecle"]}
  2. execute as @e[tag=circle] at @s run function minecraft:circle
  3. kill @e[tag=ciecle]
复制代码
minecraft:circle.mcfunction
  1. particle minecraft:heart ^ ^ ^10
  2. tp @s ~ ~ ~ ~10 ~
  3. acoreboard players add @s circle 1
  4. execute if score @s circle matches ..35 run function minecraft:circle
复制代码



螺旋前进可以用以下方法
  1. summon armor_stand ~ ~ ~ {Tags:["mark"],NoGravity:1}
复制代码
循环执行以下命令
  1. execute as @e[type=armor_stand,tag=mark,x_rotation=-90] at @s run tp @s ~ ~ ~ ~ 90
  2. execute as @e[type=armor_stand,tag=mark] at @s run tp @s ~ ~ ~ ~ ~-10
  3. execute at @e[type=armor_stand,tag=mark] run particle minecraft:heart ^ ^ ^2
  4. execute at @e[type=armor_stand,tag=mark] run particle minecraft:heart ^ ^ ^-2
  5. execute as @e[type=armor_stand,tag=mark] at @s run tp @s ^0.5 ^ ^
复制代码



抛物线较麻烦,我套用了好多个递归才拿下,不知道有没有人有更好的方法
  1. scoreboard objectives add move dummy
  2. scoreboard objectives add time dummy
复制代码
游戏内执行
  1. summon armor_stand ~ ~ ~ {Tags:["parabolic"]}
  2. scoreboard players set @e[tag=parabolic] move 7
  3. execute as @e[type=armor_stand,tag=parabolic] at @s run function minecraft:parabolic
  4. kill @e[tag=parabolic]
复制代码
parabolic.mcfunction
  1. scoreboard players operation @s time = @s move
  2. execute if score @s move matches 1.. run function minecraft:up
  3. execute if score @s move matches ..-1 run function minecraft:down
  4. particle minecraft:heart ~ ~ ~
  5. tp ^ ^ ^1
  6. scoreboard players remove @s move 1
  7. execute unless score @s move matches -7 run function minecraft:parabolic
复制代码
up.mcfunction
  1. execute at @s run tp ~ ~1 ~
  2. scoreboard players remove @s time 1
  3. execute unless score @s time matches 0 run function minecraft:up
复制代码
down.mcfunction
  1. execute at @s run tp ~ ~-1 ~
  2. scoreboard players add @s time 1
  3. execute unless score @s time matches 0 run function minecraft:up
复制代码