23 lines
1.0 KiB
Mcfunction
23 lines
1.0 KiB
Mcfunction
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
|