Commands to run once:
/give @p minecraft:carrot_on_a_stick 1 0 {Unbreakable:1,MGUN:1,display:{Name:"Machine Gun"}}
/scoreboard objectives add MGUN stat.useItem.minecraft.carrot_on_a_stick
COLUMN 1
/scoreboard players reset @a[score_MGUN_min=1] MGUN
kill @e[score_MGUN_min=46]
execute @e[score_MGUN_min=5,score_MGUN=25] ~ ~ ~ effect @e[r=2,tag=!shtMGUN] instant_damage 1 1 true
execute @e[score_MGUN_min=5,score_MGUN=25] ~ ~ ~ effect @e[r=1,tag=shtMGUN] instant_damage 1 255 true
execute @e[score_MGUN_min=5,score_MGUN=25] ~ ~ ~ particle lava ~ ~ ~ 0 0 0 1 10 force
execute @e[score_MGUN_min=5,score_MGUN=25] ~ ~ ~ /playsound entity.zombie.attack_iron_door master @a ~ ~ ~ 4
execute @e[score_MGUN_min=5,score_MGUN=25] ~ ~ ~ /playsound entity.generic.explode master @a ~ ~ ~ 4
execute @e[score_MGUN_min=5,score_MGUN=25] ~ ~ ~ /playsound entity.wither.break_block master @a ~ ~ ~ 4 0
execute @e[score_MGUN_min=5,score_MGUN=25] ~ ~ ~ spreadplayers ~ ~ 1 5 false @e[tag=MGUNbllt,c=1]
/scoreboard players add @e[tag=MGUNbllt] MGUN 1
execute @e[tag=shtMGUN,score_MGUN_min=1] ~ ~ ~ summon ArmorStand ~ ~ ~ {Tags:[MGUNbllt],Marker:1,Invisible:1,Invulnerable:1}
scoreboard players tag @a add shtMGUN {SelectedItem:{id:minecraft:carrot_on_a_stick,tag:{MGUN:1}}}
scoreboard players tag @a remove shtMGUN
How it works:
See what's inside of each command block!
© Cimap. All Rights Reserved
This website is not endorsed, associated or affiliated with Mojang AB.