minecraft-expanded-datapack/data/undeadm-m1/functions/entity/spawn/magic_missile.mcfunction

23 lines
1.0 KiB
Mcfunction
Raw Normal View History

2021-02-20 11:10:44 +00:00
tellraw @a[scores={me-debugging=1..}] "undeadm-m1:spawn/magic_missile"
summon minecraft:armor_stand ^ ^ ^1 {Invisible:1b,Marker:1,Tags:["EntityTimer","MagicMissile","Init"]}
# link uid to player
execute at @s as @e[tag=Init] store result score @s me-core_uid run scoreboard players get @p me-core_uid
# init variables
execute as @e[tag=Init] run scoreboard players set @s me-core_entityMT 100
execute as @e[tag=Init] run scoreboard players set @s me-core_entityC1 2
# set CD equal to entity max time
execute at @s as @e[tag=Init] if score @s me-core_uid = @p me-core_uid run scoreboard players operation @p me-weap_staffCD = @s me-core_entityMT
execute at @s as @e[tag=Init] if score @s me-core_uid = @p me-core_uid run scoreboard players operation @p me-weap_staffCD += $10 me-weap_staffCD
# flavour!
execute as @e[tag=Init] run playsound undeadm-m1:entity.magic_missile.spawn neutral @a ~ ~ ~
playsound undeadm-m1:entity.magic_missile.die neutral @a ~ ~ ~ 1
# stop projectile from getting any more init data
execute as @e[tag=Init] run tag @s remove Init