『原理』
第1遍n叉生成实体绳结, 第2遍n叉生成筛选(遍历位置为空气)实体绳结,根据第2遍n差遍历的位置,在某个范围内存在绳结这个实体,则视角采取玩家,采取第1遍历n差,再次遍历出来的位置,执行一定范围内的清除实体-------这一部就用很简单的一种判定实体存不存在的方式,实现限定粒子的生成
鱼钩在非法位置纠正具有延迟性
绳结的不稳定性
『思路』
存在鱼钩时,以该鱼钩为中心,距离自身最近的两个实体标上标签
纠正鱼钩的视角并将其传送到非法位置,视角与玩家相反
以玩家为中心,往前提n格(N为n差遍历的最大长度),实际出现在玩家的视角正前方,执行n叉树遍历位置并执行命令生成绳结实体
同样以玩家为中心往前提,n+0.2~0.25格,执行nx并筛选非空气位置执行生成绳结
*同样以玩家为中心往前提,N+0.2~0.25格,执行n差并筛选一定范围内存在两个绳结的位置,并以该位置为中心,选择离其最近的一个绳结,以玩家为视角,往前tp true一定距离(根据不稳定性,如果不完整方块允许通过则消失,是为通路,如果不允许通过则不消失,视为断路)
同样以玩家为中心往前提,N+0.2~0.25格,执行n差并筛选一定范围内存在两个绳结的位置,并以该位置为中心,选择离其最近的一个绳结,以玩家为视角,往前n格,执行n叉树遍历位置执行范围清除绳结
以绳结这个实体为中心执行粒子
以绳结这个实体为中心执行范围伤害
(根据绳结的不稳定性,当其受到一点伤害的时候会自动消失)
清除标签
『指令』
(统一第1个红石条件循环,其余连锁无条件)
1:纯穿墙,5cb
execute as@e[type=fishing_hook] at@s run tag @e[c=2] add 枪
execute as@e[type=fishing_hook,tag=枪] at@s rotated as@p run tp ^^^40 facing ^^^-10
execute as@a[tag=枪] at@s anchored eyes positioned ^^^8 rotated as@e[tag=枪] positioned ^^^4 rotated as@e[tag=枪] positioned ^^^2 rotated as @e[tag=枪] positioned ^^^1 rotated as @e[tag=枪] positioned ^^^0.5 run particle minecraft:endrod
execute as@a[tag=枪] at@s anchored eyes positioned ^^^8 rotated as@e[tag=枪] positioned ^^^4 rotated as@e[tag=枪] positioned ^^^2 rotated as @e[tag=枪] positioned ^^^1 rotated as @e[tag=枪] positioned ^^^0.5 run damage @e[r=2,tag=!枪] 1
tag @e remove 枪
2:纯不穿墙,8cb
execute as@e[type=fishing_hook] at@s run tag @e[c=2] add 枪
execute as@e[type=fishing_hook,tag=枪] at@s rotated as@p run tp ^^^40 facing ^^^-10
execute as@a[tag=枪] at@s anchored eyes positioned ^^^8 rotated as@e[tag=枪] positioned ^^^4 rotated as@e[tag=枪] positioned ^^^2 rotated as @e[tag=枪] positioned ^^^1 rotated as @e[tag=枪] positioned ^^^0.5 run summon leash_knot
execute as @p[tag=枪] at @s anchored eyes positioned ^^^8.2 rotated as @e[tag=枪] positioned ^^^4 Rotated as @e[tag=枪] positioned ^^^0.5 rotated as @e[tag=枪] positioned ^^^2 rotated as @e[tag=枪] positioned ^^^1 unless block ~~~ air run summon leash_knot
execute as @p[tag=枪] at @s anchored eyes positioned ^^^8.2 rotated as @e[tag=枪] positioned ^^^4 Rotated as @e[tag=枪] positioned ^^^0.5 rotated as @e[tag=枪] positioned ^^^2 rotated as @e[tag=枪] positioned ^^^1 if entity @e[type=leash_knot,r=0.13] run execute rotated as@p[tag=枪] positioned ^^^8 rotated as @e[tag=枪] positioned ^^^4 Rotated as @e[tag=枪] positioned ^^^0.5 rotated as @e[tag=枪] positioned ^^^2 rotated as @e[tag=枪] positioned ^^^1 run kill @e[r=1.1,type=leash_knot]
Execute at@e[Type=leash_knot] run particle minecraft:basic_flame_particle
Execute at@e[Type=leash_knot] run damage @e[r=2,tag=!枪] 1
tag @e remove 枪
3:穿透力较低(非完整方块),9cb
execute as@e[type=fishing_hook] at@s run tag @e[c=2] add 枪
execute as@e[type=fishing_hook,tag=枪] at@s rotated as@p run tp ^^^40 facing ^^^-10
execute as@a[tag=枪] at@s anchored eyes positioned ^^^8 rotated as@e[tag=枪] positioned ^^^4 rotated as@e[tag=枪] positioned ^^^2 rotated as @e[tag=枪] positioned ^^^1 rotated as @e[tag=枪] positioned ^^^0.5 run summon leash_knot
execute as @p[tag=枪] at @s anchored eyes positioned ^^^8.2 rotated as @e[tag=枪] positioned ^^^4 Rotated as @e[tag=枪] positioned ^^^0.5 rotated as @e[tag=枪] positioned ^^^2 rotated as @e[tag=枪] positioned ^^^1 unless block ~~~ air run summon leash_knot
execute as @p[tag=枪] at @s anchored eyes positioned ^^^8.2 rotated as @e[tag=枪] positioned ^^^4 Rotated as @e[tag=枪] positioned ^^^0.5 rotated as @e[tag=枪] positioned ^^^2 rotated as @e[tag=枪] positioned ^^^1 unless block ~~~ air run execute as @e[type=leash_knot,c=1,r=0.19] at@s rotated as@p[tag=枪] if block ^^^-0.3 air run tp @s ^^^0.3 true
execute as @p[tag=枪] at @s anchored eyes positioned ^^^8.2 rotated as @e[tag=枪] positioned ^^^4 Rotated as @e[tag=枪] positioned ^^^0.5 rotated as @e[tag=枪] positioned ^^^2 rotated as @e[tag=枪] positioned ^^^1 if entity @e[type=leash_knot,r=0.15] run execute rotated as@p[tag=枪] positioned ^^^8 rotated as @e[tag=枪] positioned ^^^4 Rotated as @e[tag=枪] positioned ^^^0.5 rotated as @e[tag=枪] positioned ^^^2 rotated as @e[tag=枪] positioned ^^^1 run kill @e[r=1.1,type=leash_knot]
Execute at@e[Type=leash_knot] run particle minecraft:villager_happy
Execute at@e[Type =leash_knot] run damage @e[r=2,tag=!枪] 1
tag @e remove 枪
4:穿透力强(非完整方块)10cb
execute as@e[type=fishing_hook] at@s run tag @e[c=2] add 枪
execute as@e[type=fishing_hook,tag=枪] at@s rotated as@p run tp ^^^40 facing ^^^-10
execute as@a[tag=枪] at@s anchored eyes positioned ^^^8 rotated as@e[tag=枪] positioned ^^^4 rotated as@e[tag=枪] positioned ^^^2 rotated as @e[tag=枪] positioned ^^^1 rotated as @e[tag=枪] positioned ^^^0.5 run summon leash_knot
execute as @p[tag=枪] at @s anchored eyes positioned ^^^8.2 rotated as @e[tag=枪] positioned ^^^4 Rotated as @e[tag=枪] positioned ^^^0.5 rotated as @e[tag=枪] positioned ^^^2 rotated as @e[tag=枪] positioned ^^^1 unless block ~~~ air run summon leash_knot
execute as @p[tag=枪] at @s anchored eyes positioned ^^^8.2 rotated as @e[tag=枪] positioned ^^^4 Rotated as @e[tag=枪] positioned ^^^0.5 rotated as @e[tag=枪] positioned ^^^2 rotated as @e[tag=枪] positioned ^^^1 unless block ~~~ air run execute as @e[type=leash_knot,c=1,r=0.19] at@s rotated as@p[tag=枪] if block ^^^0.5 air run tp @s ^^^-0.25 true
execute as @p[tag=枪] at @s anchored eyes positioned ^^^8.2 rotated as @e[tag=枪] positioned ^^^4 Rotated as @e[tag=枪] positioned ^^^0.5 rotated as @e[tag=枪] positioned ^^^2 rotated as @e[tag=枪] positioned ^^^1 unless block ~~~ air run execute as @e[type=leash_knot,c=1,r=0.19] at@s rotated as@p[tag=枪] if block ^^^-0.5 air run tp @s ^^^0.25 true
execute as @p[tag=枪] at @s anchored eyes positioned ^^^8.2 rotated as @e[tag=枪] positioned ^^^4 Rotated as @e[tag=枪] positioned ^^^0.5 rotated as @e[tag=枪] positioned ^^^2 rotated as @e[tag=枪] positioned ^^^1 if entity @e[type=leash_knot,r=0.15] run execute rotated as@p[tag=枪] positioned ^^^8 rotated as @e[tag=枪] positioned ^^^4 Rotated as @e[tag=枪] positioned ^^^0.5 rotated as @e[tag=枪] positioned ^^^2 rotated as @e[tag=枪] positioned ^^^1 run kill @e[r=1.1,type=leash_knot]
Execute at@e[Type=leash_knot] run particle minecraft:basic_crit_particle
Execute at@e[Type =leash_knot] run damage @e[r=2,tag=!枪] 1
tag @e remove 枪
『测试区命令』
(没有特殊标记的话全部是脉冲红色条件,主要是测试鱼钩的延迟性以及绳结这个实体的不稳定性,跟视频主题毫无关联)
/summon leash_knot ~~1~
damage @e[type=leash_knot] 1
/execute as@e[type=leash_knot] at@s run tp @s ~~~-1 true
execute as@e[type=fishing_hook] at@s run tp @s ~~~40
execute as@e[type=fishing_hook] run say 1(连锁无条件)
*小贴士:录制的时候发现网页的某些光影会导致一些粒子效果直接失效!建议各位玩家在进行测试的时候,尽量避免使用网易的光影,因为到时候想我一样摸不着头脑
免责声明:本文系网络转载或改编,未找到原创作者,版权归原作者所有。如涉及版权,请联系删