编写:小皮果吖
版本:网易基岩手机版
●前置指令聊天栏输入
/scoreboard objectives add pgd dummy
/scoreboard objectives add pgq dummy
●注:计分板“pgd”用于计算子弹数量
计分板“pgq”用于计算鱼竿枪生成的船数
“铁粒”作为子弹,抬头即可补充
●其它准备:做一格岩浆并记录岩浆坐标
●一共24个命令方块
1循环无条件保持开启
2至21连锁无条件保持开启
22循环无条件保持开启延迟10
23和24连锁无条件保持开启
●第一部分:射出子弹
⒈循环无条件保持开启
/execute @e[type=fishing_hook] ~~~ execute @p[r=1.8,scores={pgd=1..}] ~~~ summon boat ~~~
⒉连锁无条件保持开启
/execute @e[type=fishing_hook] ~~~ execute @p[scores={pgd=1..},r=1.8] ~~~ scoreboard players remove @s pgd 1
⒊连锁无条件保持开启
/execute @e[type=fishing_hook] ~~~ execute @p[scores={pgd=..0},r=1.8] ~~~tellraw @s {"rawtext":[{"text":"§l§c子弹不足!"}]}
⒋连锁无条件保持开启
/execute @e[type=fishing_hook] ~~~ execute @p[r=1.8] ~~~ tp @e[type=boat,r=2,c=1] ^^^0.1 facing ~~~
⒌连锁无条件保持开启
/execute @e[type=fishing_hook] ~~~ execute @p[r=1.8] ~~~ tp @e[type=boat,c=1,r=2] ~~871 ~
⒍连锁无条件保持
/execute @e[type=fishing_hook] ~~~ execute @p[r=1.8,scores={pgd=1..}] ~~~ playsound mob.zombie.woodbreak @a[r=17]
⒎连锁无条件保持
/tp @e[type=fishing_hook] 岩浆坐标
第二部分:击中目标
⒏连锁无条件保持开启
/execute @e[scores={pgq=2..},type=boat] ~~-871 ~ execute @e[type=!boat,type=!item,type=!xp_orb,type=!egg,type=!arrow,type=!ender_crystal,type=!snowball,c=1,r=1] ~~871 ~ tag @e[r=1,c=1,type=boat] add 击中
⒐连锁无条件保持开启
/execute @e[scores={pgq=2..},type=boat] ~~-871~ damage @e[c=1,r=1] 5
⒑连锁无条件保持开启
/kill @e[type=boat,tag=击中]
第三部分:子弹轨迹
⒒连锁无条件保持开启
/execute @e[type=boat] ~~~ tp ^^^-1
⒓连锁无条件保持开启
/scoreboard players add @e[type=boat] pgq 1
⒔连锁无条件保持开启
/execute @e[type=boat] ~~-871 ~ particle minecraft:cauldron_explosion_emitter ~~1.5~
⒕连锁无条件保持开启
/kill @e[type=boat,scores={pgq=60..}]
第四部分:防止穿墙
⒖连锁无条件保持开启
/tag @e[type=boat] add 障碍
⒗连锁无条件保持开启
/execute @e[tag=障碍,type=boat] ~~-871 ~ detect ~~1.5 ~ air 0 tag @s remove 障碍
⒘连锁无条件保持开启
/kill @e[tag=障碍,type=boat]
第五部分:子弹补充
⒙连锁无条件保持开启
/scoreboard players add @a[scores={pgd=..98},hasitem={item=iron_nugget,quantity=1..},rx=-88] pgd 1
⒚连锁无条件保持开启
/playsound tile.piston.out @a[hasitem={item=iron_nugget,quantity=1..},rx=-87,scores={pgd=..98}]
⒛连锁无条件保持开启
/clear @a[hasitem={item=iron_nugget,quantity=1..},rx=-87,scores={pgd=..98}] iron_nugget 0 1
第六:信息显示
21.连锁无条件保持开启
/execute @a[hasitem={item=fishing_rod,location=slot.weapon.mainhand}] ~ ~ ~ titleraw @s actionbar {"rawtext":[{"text":"§l§7【§b鱼竿§3子弹数§6 "},{"score":{"name":"@s","objective":"pgd"}},{"text":"§e/99§7】"},{"text":"\n【§b射程§315格§7●§b伤害§35点§7】"}]}
——分割线——
第七部分:瞄准显示
⒈循环无条件保持开启延迟10
/title @a[hasitem={item=fishing_rod,location=slot.weapon.mainhand}] times 0 10 0
⒉连锁无条件保持开启
/title @a[hasitem={item=fishing_rod,location=slot.weapon.mainhand}] title §l
⒊连锁无条件保持开启
/title @a[hasitem={item=fishing_rod,location=slot.weapon.mainhand}] subtitle 『 §a▽ §f』
——完