如题,1.12.2原版
如何追踪玩家并向他朝向的方向生成向前飞的凋零头?
如何追踪玩家并向他朝向的方向生成向前飞的凋零头?
用function还是用命令方块?
暴力的基本思路就是
穷举玩家每一个方向 然后往这个方向飞骷髅头
暴力的基本思路就是
穷举玩家每一个方向 然后往这个方向飞骷髅头
如果说有1.13+的新版execute的话,还比较容易做到,1.12.2的话或许能做到,但应该很麻烦。
1.12.2里面我有做到八个方向的,献丑回答一下:
首先创建函数A,不断循环侦测玩家目前面向,并清除&给予标签:
scoreboard players tag @p remove lookat1 scoreboard players tag @p remove lookat2 scoreboard players tag @p remove lookat3 scoreboard players tag @p remove lookat4 scoreboard players tag @p remove lookat5 scoreboard players tag @p remove lookat6 scoreboard players tag @p remove lookat7 scoreboard players tag @p remove lookat8 scoreboard players tag @p[ry=23,rym=-22] add lookat1 scoreboard players tag @p[ry=68,rym=24] add lookat2 scoreboard players tag @p[ry=113,rym=69] add lookat3 scoreboard players tag @p[ry=158,rym=114] add lookat4 scoreboard players tag @p[ry=-158,rym=159] add lookat5 scoreboard players tag @p[ry=-113,rym=-157] add lookat6 scoreboard players tag @p[ry=-68,rym=-112] add lookat7 scoreboard players tag @p[ry=-23,rym=-67] add lookat8 |
当要开始执行时,跑一次函数B
execute @p[tag=lookat1] ~ ~ ~ summon minecraft:armor_stand ~ ~1 ~ {Invulnerable:0b,ShowArms:0b,DisabledSlots:0s,DeathTime:0s,Invisible:1b,ArmorItems:[{},{},{},{id:"minecraft:skull",Count:1b,Damage:1s}],Small:1b,NoBasePlate:1b,Tags:["goskull"],Rotation:[0f]} execute @p[tag=lookat2] ~ ~ ~ summon minecraft:armor_stand ~ ~1 ~ {Invulnerable:0b,ShowArms:0b,DisabledSlots:0s,DeathTime:0s,Invisible:1b,ArmorItems:[{},{},{},{id:"minecraft:skull",Count:1b,Damage:1s}],Small:1b,NoBasePlate:1b,Tags:["goskull"],Rotation:[45f]} execute @p[tag=lookat3] ~ ~ ~ summon minecraft:armor_stand ~ ~1 ~ {Invulnerable:0b,ShowArms:0b,DisabledSlots:0s,DeathTime:0s,Invisible:1b,ArmorItems:[{},{},{},{id:"minecraft:skull",Count:1b,Damage:1s}],Small:1b,NoBasePlate:1b,Tags:["goskull"],Rotation:[90f]} execute @p[tag=lookat4] ~ ~ ~ summon minecraft:armor_stand ~ ~1 ~ {Invulnerable:0b,ShowArms:0b,DisabledSlots:0s,DeathTime:0s,Invisible:1b,ArmorItems:[{},{},{},{id:"minecraft:skull",Count:1b,Damage:1s}],Small:1b,NoBasePlate:1b,Tags:["goskull"],Rotation:[135f]} execute @p[tag=lookat5] ~ ~ ~ summon minecraft:armor_stand ~ ~1 ~ {Invulnerable:0b,ShowArms:0b,DisabledSlots:0s,DeathTime:0s,Invisible:1b,ArmorItems:[{},{},{},{id:"minecraft:skull",Count:1b,Damage:1s}],Small:1b,NoBasePlate:1b,Tags:["goskull"],Rotation:[-180f]} execute @p[tag=lookat6] ~ ~ ~ summon minecraft:armor_stand ~ ~1 ~ {Invulnerable:0b,ShowArms:0b,DisabledSlots:0s,DeathTime:0s,Invisible:1b,ArmorItems:[{},{},{},{id:"minecraft:skull",Count:1b,Damage:1s}],Small:1b,NoBasePlate:1b,Tags:["goskull"],Rotation:[-135f]} execute @p[tag=lookat7] ~ ~ ~ summon minecraft:armor_stand ~ ~1 ~ {Invulnerable:0b,ShowArms:0b,DisabledSlots:0s,DeathTime:0s,Invisible:1b,ArmorItems:[{},{},{},{id:"minecraft:skull",Count:1b,Damage:1s}],Small:1b,NoBasePlate:1b,Tags:["goskull"],Rotation:[-90f]} execute @p[tag=lookat8] ~ ~ ~ summon minecraft:armor_stand ~ ~1 ~ {Invulnerable:0b,ShowArms:0b,DisabledSlots:0s,DeathTime:0s,Invisible:1b,ArmorItems:[{},{},{},{id:"minecraft:skull",Count:1b,Damage:1s}],Small:1b,NoBasePlate:1b,Tags:["goskull"],Rotation:[-45f]} execute @p[tag=lookat1] ~ ~0.8 ~ summon minecraft:snowball ~1 ~ ~1 {Motion:[0.4d,1.0d,0.4d]} execute @p[tag=lookat2] ~ ~0.8 ~ summon minecraft:snowball ~ ~ ~1 {Motion:[0.0d,1.0d,0.4d]} execute @p[tag=lookat3] ~ ~0.8 ~ summon minecraft:snowball ~-1 ~ ~1 {Motion:[-0.4d,1.0d,0.4d]} execute @p[tag=lookat4] ~ ~0.8 ~ summon minecraft:snowball ~-1 ~ ~ {Motion:[-0.4d,1.0d,0.0d]} execute @p[tag=lookat5] ~ ~0.8 ~ summon minecraft:snowball ~-1 ~ ~-1 {Motion:[-0.4d,1.0d,-0.4d]} execute @p[tag=lookat6] ~ ~0.8 ~ summon minecraft:snowball ~ ~ ~-1 {Motion:[0.0d,1.0d,-0.4d]} execute @p[tag=lookat7] ~ ~0.8 ~ summon minecraft:snowball ~1 ~ ~-1 {Motion:[0.4d,1.0d,-0.4d]} execute @p[tag=lookat8] ~ ~0.8 ~ summon minecraft:snowball ~1 ~ ~ {Motion:[0.4d,1.0d,0.0d]} |
如此就会产生射向八个方向的头颅、雪球(雪球可能要透过资源包改成透明)
接着设定将带着头颅的盔甲座tp到雪球(这些放到函数A也可以)
tp @e[tag=goskull] @e[type=snowball]
当此盔甲座头颅触地时给予标签,并消除有该标签的盔甲座
scoreboard players tag @e[tag=goskull] add godie {OnGround:1b}
execute @p ~ ~ ~ kill @e[tag=godie]