我的世界服务器道具制作

枪械指令简易版2.0
/scoreboard objectives add 伤害 dummy
/scoreboard objectives add 伤害a dummy
/scoreboard objectives add 换弹 dummy
/scoreboard objectives add 弹药 dummy
[第一个循环,其他全部连锁,无条件,常开]
[枪械伤害设置与添加]♥
scoreboard players add @a 伤害 0
scoreboard players add @a 换弹 0
scoreboard players add @a 弹药 0
scoreboard players add @a[scores={伤害=0}] 伤害 5
scoreboard players add @a[hasitem={item=heart_of_the_sea,quantity=1..,location=slot.hotbar}] 伤害 1
tellraw @a[hasitem={item=heart_of_the_sea,quantity=1..,location=slot.hotbar}] {"rawtext":[{"text":"§l§o§b步枪§c伤害+1"}]}
clear @a[hasitem={item=heart_of_the_sea,quantity=1..,location=slot.hotbar}] heart_of_the_sea 0 1
[枪械准星]♥
title @a[hasitem={item=fishing_rod,location=slot.weapon.mainhand}] title §r
title @a[hasitem={item=fishing_rod,location=slot.weapon.mainhand}] subtitle §b+§c
title @a[hasitem={item=fishing_rod,location=slot.weapon.mainhand}] times 0 100 0
[开枪]♥
execute @e[type=minecraft:fishing_hook] ~~~ tag @a[scores={弹药=1..},r=2,hasitem={item=fishing_rod,location=slot.weapon.mainhand}] add 射击
execute @e[type=minecraft:fishing_hook] ~~~ tag @a[scores={弹药=1..},r=2,hasitem={item=fishing_rod,location=slot.weapon.mainhand}] add 射击a
[音效]♥
execute @a[tag=射击] ~~~ playsound mob.zombie.woodbreak @a[r=30] ~~~ 1 2
[后坐力]♥
execute @a[tag=射击] ~~~ camerashake add @s 2 0.05 positional
[扣除子弹]♥
scoreboard players remove @a[tag=射击,scores={弹药=1..}] 弹药 1
execute @a[tag=射击] ^ ^1 ^0.5 detect ~ ~1 ~ air 0 tag @s add 墙
tag @a[tag=射击,tag=!墙] remove 射击
[射程]♥1
execute @a[tag=射击] ^ ^0.5 ^1 scoreboard players operation @e[r=1,c=1,tag=!射击a] 伤害a=@s 伤害
execute @a[tag=射击] ^ ^1.5 ^1 particle minecraft:balloon_gas_particle ~~~tag @a[tag=射击] remove 墙
execute @a[tag=射击] ^ ^0.5 ^2 detect ~ ~1 ~ air 0 tag @s add 墙
tag @a[tag=射击,tag=!墙] remove 射击
[射程]♥2
execute @a[tag=射击] ^ ^0.5 ^2 scoreboard players operation @e[r=1,c=1,tag=!射击a] 伤害a=@s 伤害
execute @a[tag=射击] ^ ^1.5 ^2 particle minecraft:balloon_gas_particle ~~~tag @a[tag=射击] remove 墙
execute @a[tag=射击] ^ ^0.5 ^3 detect ~ ~1 ~ air 0 tag @s add 墙
tag @a[tag=射击,tag=!墙] remove 射击
[射程]♥3
execute @a[tag=射击] ^ ^0.5 ^3 scoreboard players operation @e[r=1,c=1,tag=!射击a] 伤害a=@s 伤害
execute @a[tag=射击] ^ ^1.5 ^3 particle minecraft:balloon_gas_particle ~~~
tag @a[tag=射击] remove 墙
execute @a[tag=射击] ^ ^0.5 ^4 detect ~ ~1 ~ air 0 tag @s add 墙
tag @a[tag=射击,tag=!墙] remove 射击
[射程]♥4
execute @a[tag=射击] ^ ^0.5 ^4 scoreboard players operation @e[r=1,c=1,tag=!射击a] 伤害a=@s 伤害
execute @a[tag=射击] ^ ^1.5 ^4 particle minecraft:balloon_gas_particle ~~~
tag @a[tag=射击] remove 墙execute @a[tag=射击] ^ ^0.5 ^5 detect ~ ~1 ~ air 0 tag @s add 墙
tag @a[tag=射击,tag=!墙] remove 射击
[射程]♥5
execute @a[tag=射击] ^ ^0.5 ^5 scoreboard players operation @e[r=1,c=1,tag=!射击a] 伤害a=@s 伤害
execute @a[tag=射击] ^ ^1.5 ^5 particle minecraft:balloon_gas_particle ~~~
tag @a[tag=射击] remove 墙
execute @a[tag=射击] ^ ^0.5 ^6 detect ~ ~1 ~ air 0 tag @s add 墙
tag @a[tag=射击,tag=!墙] remove 射击
[射程]♥6
execute @a[tag=射击] ^ ^0.5 ^6 scoreboard players operation @e[r=1,c=1,tag=!射击a] 伤害a=@s 伤害
execute @a[tag=射击] ^ ^1.5 ^6 particle minecraft:balloon_gas_particle ~~~
tag @a[tag=射击] remove 墙
execute @a[tag=射击] ^ ^0.5 ^7 detect ~ ~1 ~ air 0 tag @s add 墙
tag @a[tag=射击,tag=!墙] remove 射击
[射程]♥7
execute @a[tag=射击] ^ ^0.5 ^7 scoreboard players operation @e[r=1,c=1,tag=!射击a] 伤害a=@s 伤害
execute @a[tag=射击] ^ ^1.5 ^7 particle minecraft:balloon_gas_particle ~~~tag @a[tag=射击] remove 墙
execute @a[tag=射击] ^ ^0.5 ^8 detect ~ ~1 ~ air 0 tag @s add 墙
tag @a[tag=射击,tag=!墙] remove 射击
[射程]♥8
execute @a[tag=射击] ^ ^0.5 ^8 scoreboard players operation @e[r=1,c=1,tag=!射击a] 伤害a=@s 伤害
execute @a[tag=射击] ^ ^1.5 ^8 particle minecraft:balloon_gas_particle ~~~
tag @a[tag=射击] remove 墙
execute @a[tag=射击] ^ ^0.5 ^9 detect ~ ~1 ~ air 0 tag @s add 墙
tag @a[tag=射击,tag=!墙] remove 射击
tag @a[tag=射击,tag=!墙] remove 射击
[射程]♥9
execute @a[tag=射击] ^ ^0.5 ^9 scoreboard players operation @e[r=1,c=1,tag=!射击a] 伤害a=@s 伤害
execute @a[tag=射击] ^ ^1.5 ^9 particle minecraft:balloon_gas_particle ~~~tag @a[tag=射击] remove 墙
execute @a[tag=射击] ^ ^0.5 ^10 detect ~ ~1 ~ air 0 tag @s add 墙
tag @a[tag=射击,tag=!墙] remove 射击
[射程]♥10
execute @a[tag=射击] ^ ^0.5 ^10 scoreboard players operation @e[r=1,c=1,tag=!射击a] 伤害a=@s 伤害
execute @a[tag=射击] ^ ^1.5 ^10 particle minecraft:balloon_gas_particle ~~~
tag @a[tag=射击] remove 墙
execute @a[tag=射击] ^ ^0.5 ^11 detect ~ ~1 ~ air 0 tag @s add 墙
tag @a[tag=射击,tag=!墙] remove 射击
[射程]♥11
execute @a[tag=射击] ^ ^0.5 ^11 scoreboard players operation @e[r=1,c=1,tag=!射击a] 伤害a=@s 伤害
execute @a[tag=射击] ^ ^1.5 ^11 particle minecraft:balloon_gas_particle ~~~
tag @a[tag=射击] remove 墙
execute @a[tag=射击] ^ ^0.5 ^12 detect ~ ~1 ~ air 0 tag @s add 墙
tag @a[tag=射击,tag=!墙] remove 射击
[射程]♥12
execute @a[tag=射击] ^ ^0.5 ^12 scoreboard players operation @e[r=1,c=1,tag=!射击a] 伤害a=@s 伤害
execute @a[tag=射击] ^ ^1.5 ^12 particle minecraft:balloon_gas_particle ~~~
tag @a[tag=射击] remove 墙
execute @a[tag=射击] ^ ^0.5 ^13 detect ~ ~1 ~ air 0 tag @s add 墙
tag @a[tag=射击,tag=!墙] remove 射击
[射程]♥13
execute @a[tag=射击] ^ ^0.5 ^13 scoreboard players operation @e[r=1,c=1,tag=!射击a] 伤害a=@s 伤害
execute @a[tag=射击] ^ ^1.5 ^13 particle minecraft:balloon_gas_particle ~~~
tag @a[tag=射击] remove 墙
execute @a[tag=射击] ^ ^0.5 ^14 detect ~ ~1 ~ air 0 tag @s add 墙
tag @a[tag=射击,tag=!墙] remove 射击
[射程]♥14
execute @a[tag=射击] ^ ^0.5 ^14 scoreboard players operation @e[r=1,c=1,tag=!射击a] 伤害a=@s 伤害
execute @a[tag=射击] ^ ^1.5 ^14 particle minecraft:balloon_gas_particle ~~~
tag @a[tag=射击] remove 墙
execute @a[tag=射击] ^ ^0.5 ^15 detect ~ ~1 ~ air 0 tag @s add 墙
tag @a[tag=射击,tag=!墙] remove 射击
[射程]♥15
execute @a[tag=射击] ^ ^0.5 ^15 scoreboard players operation @e[r=1,c=1,tag=!射击a] 伤害a=@s 伤害
execute @a[tag=射击] ^ ^1.5 ^15 particle minecraft:balloon_gas_particle ~~~
tag @a[tag=射击] remove 墙
execute @a[tag=射击] ^ ^0.5 ^16 detect ~ ~1 ~ air 0 tag @s add 墙
tag @a[tag=射击,tag=!墙] remove 射击
[射程]♥16
execute @a[tag=射击] ^ ^0.5 ^16 scoreboard players operation @e[r=1,c=1,tag=!射击a] 伤害a=@s 伤害
execute @a[tag=射击] ^ ^1.5 ^16 particle minecraft:balloon_gas_particle ~~~
tag @a[tag=射击] remove 墙
execute @a[tag=射击] ^ ^0.5 ^17 detect ~ ~1 ~ air 0 tag @s add 墙
tag @a[tag=射击,tag=!墙] remove 射击
[射程]♥17
execute @a[tag=射击] ^ ^0.5 ^17 scoreboard players operation @e[r=1,c=1,tag=!射击a] 伤害a=@s 伤害
execute @a[tag=射击] ^ ^1.5 ^17 particle minecraft:balloon_gas_particle ~~~
tag @a[tag=射击] remove 墙
execute @a[tag=射击] ^ ^0.5 ^18 detect ~ ~1 ~ air 0 tag @s add 墙
tag @a[tag=射击,tag=!墙] remove 射击
[射程]♥18
execute @a[tag=射击] ^ ^0.5 ^18 scoreboard players operation @e[r=1,c=1,tag=!射击a] 伤害a=@s 伤害
execute @a[tag=射击] ^ ^1.5 ^18 particle minecraft:balloon_gas_particle ~~~
tag @a[tag=射击] remove 墙
execute @a[tag=射击] ^ ^0.5 ^19 detect ~ ~1 ~ air 0 tag @s add 墙
tag @a[tag=射击,tag=!墙] remove 射击
[射程]♥19
execute @a[tag=射击] ^ ^0.5 ^19 scoreboard players operation @e[r=1,c=1,tag=!射击a] 伤害a=@s 伤害
execute @a[tag=射击] ^ ^1.5 ^19 particle minecraft:balloon_gas_particle ~~~tag @a[tag=射击] remove 墙
execute @a[tag=射击] ^ ^0.5 ^20 detect ~ ~1 ~ air 0 tag @s add 墙
tag @a[tag=射击,tag=!墙] remove 射击
[射程]♥20
execute @a[tag=射击] ^ ^0.5 ^20 scoreboard players operation @e[r=1,c=1,tag=!射击a] 伤害a=@s 伤害
execute @a[tag=射击] ^ ^1.5 ^20 particle minecraft:balloon_gas_particle ~~~
[伤害]♥
execute @e[scores={伤害a=120..},type=!item,type=!minecraft:fishing_hook] ~~~ damage @s 120 projectile entity @p[tag=射击a]
execute @e[scores={伤害a=120..}] ~~~ scoreboard players remove @s 伤害a 120
execute @e[scores={伤害a=60..},type=!item,type=!minecraft:fishing_hook] ~~~ damage @s 60 projectile entity @p[tag=射击a]execute @e[scores={伤害a=60..}] ~~~ scoreboard players remove @s 伤害a 60
execute @e[scores={伤害a=30..},type=!item,type=!minecraft:fishing_hook] ~~~ damage @s 30 projectile entity @p[tag=射击a]
execute @e[scores={伤害a=30..}] ~~~ scoreboard players remove @s 伤害a 30
execute @e[scores={伤害a=16..},type=!item,type=!minecraft:fishing_hook] ~~~ damage @s 16 projectile entity @p[tag=射击a]
execute @e[scores={伤害a=16..}] ~~~ scoreboard players remove @s 伤害a 16
execute @e[scores={伤害a=8..},type=!item,type=!minecraft:fishing_hook] ~~~ damage @s 8 projectile entity @p[tag=射击a]
execute @e[scores={伤害a=8..}] ~~~ scoreboard players remove @s 伤害a 8
execute @e[scores={伤害a=4..},type=!item,type=!minecraft:fishing_hook] ~~~ damage @s 4 projectile entity @p[tag=射击a]
execute @e[scores={伤害a=4..}] ~~~ scoreboard players remove @s 伤害a 4
execute @e[scores={伤害a=2..},type=!item,type=!minecraft:fishing_hook] ~~~ damage @s 2 projectile entity @p[tag=射击a]
execute @e[scores={伤害a=2..}] ~~~ scoreboard players remove @s 伤害a 2
execute @e[scores={伤害a=1..},type=!item,type=!minecraft:fishing_hook] ~~~ damage @s 1 projectile entity @p[tag=射击a]
execute @e[scores={伤害a=1..}] ~~~ scoreboard players remove @s 伤害a 1
tag @a[tag=墙] remove 墙
tag @a[tag=射击] remove 射击
tag @a[tag=射击a] remove 射击a
scoreboard players set @a[scores={弹药=!25..,换弹=0},hasitem={item=diamond,quantity=1..,location=slot.weapon.mainhand}] 换弹 101
scoreboard players remove @a[scores={换弹=1..},hasitem={item=diamond,quantity=1..,location=slot.weapon.mainhand}] 换弹 1
scoreboard players set @a[scores={换弹=2},hasitem={item=diamond,quantity=1..,location=slot.weapon.mainhand}] 弹药 25
execute @a[scores={换弹=2},hasitem={item=diamond,quantity=1..,location=slot.weapon.mainhand}] ~~~ playsound armor.equip_gold @a[r=10] ~ ~ ~
scoreboard players remove @a[scores={换弹=1..},hasitem={item=diamond,quantity=1..,location=slot.weapon.mainhand}] 换弹 1
clear @a[scores={换弹=1},hasitem={item=diamond,quantity=1..,location=slot.weapon.mainhand}] diamond 0 1
scoreboard players set @a[scores={换弹=1}] 换弹 0
execute @a[hasitem={item=diamond,quantity=1..,location=slot.weapon.mainhand}] ~~~ titleraw @s actionbar {"rawtext":[{"translate":"%%1%%2","with":{"rawtext":[{"translate":"%%7","with":{"rawtext":[{"selector":"@s[scores={换弹=..90}]"},{"selector":"@s[scores={换弹=..70}]"},{"selector":"@s[scores={换弹=..50}]"},{"selector":"@s[scores={换弹=..30}]"},{"selector":"@s[scores={换弹=..10}]"},{"selector":"@s[scores={换弹=0}]"},{"text":"§l§o§f ▅▅▅▅▅§r"},{"text":"§l§o§d ▅▅▅▅▅§r"},{"text":"§l§o§d ▅▅▅▅§f▅§r"},{"text":"§l§o§d ▅▅▅§f▅▅§r"},{"text":"§l§o§d ▅▅§f▅▅▅§r"},{"text":"§l§o§d ▅§f▅▅▅▅§r"},{"text":"§l§o§f ▅▅▅▅▅§r"}]}},{"text":"\n§c[§b正在填充弹药§c]§r"}]}}]}
execute @a[hasitem={item=fishing_rod,location=slot.weapon.mainhand},scores={弹药=1..}] ~ ~ ~ titleraw @s actionbar {"rawtext":[{"text":"§l§o§b弹药§d剩余§r:"},{"score":{"name":"@s","objective":"弹药"}},{"text":"\n§l§o§b步枪§c伤害§r:"},{"score":{"name":"@s","objective":"伤害"}},{"text":"§r"}]}
execute @a[hasitem={item=fishing_rod,location=slot.weapon.mainhand},scores={弹药=0}] ~~~ title @s actionbar §l§o§c弹药不足