44 lines
1.6 KiB
Mcfunction
44 lines
1.6 KiB
Mcfunction
|
tellraw @a[scores={me-debugging=1..}] "undeadm-m1:tick/fire_blast"
|
||
|
|
||
|
## FireBlast CUSTOM ENTITY (VIA ARMOR STAND)
|
||
|
#
|
||
|
# Travels 20 blocks -> 10 bps during 2 seconds
|
||
|
# Collision with collisionable blocks
|
||
|
# Doesn't deal contact damage
|
||
|
# On death by collision, summon falling fires
|
||
|
#
|
||
|
# Particles:
|
||
|
# @tick: campfire_cozy_smoke: ~ ~ ~, 0 0 0, 0.0001, 1
|
||
|
# @death: lava: ^ ^ ^-0.15, 0 0 0, 0.1, 50
|
||
|
#
|
||
|
# Sounds:
|
||
|
# @death: entity.fire_blast.die: neutral, @a
|
||
|
|
||
|
## collision
|
||
|
# if no collison, move
|
||
|
execute if block ^ ^ ^0.5 #undeadm-core:no_collision run tp ^ ^ ^0.5
|
||
|
# if collision, dying
|
||
|
execute unless block ^ ^ ^0.5 #undeadm-core:no_collision run tag @s add Dying
|
||
|
|
||
|
# if it hits an entity, starts dying
|
||
|
execute if entity @s[tag=PostInit] if entity @e[gamemode=!spectator,tag=!FireBlast,dx=0,dy=0,dz=0] run tag @s add Dying
|
||
|
|
||
|
## some particles! (unless dying)
|
||
|
# first particle - cool smoke, makes the trail!
|
||
|
execute unless entity @s[tag=Dying] run particle minecraft:campfire_cosy_smoke ~ ~ ~ 0 0 0 0.001 1
|
||
|
|
||
|
## if dying
|
||
|
# reset owner's wand CD to 10 (only if greater than 10)
|
||
|
execute if entity @s[tag=Dying] as @a if score @s me-core_uid = @e[limit=1,sort=nearest,tag=FireBlast] me-core_uid if score @s me-weap_staffCD > $10 me-weap_staffCD run scoreboard players set @s me-weap_staffCD 10
|
||
|
# fire explosion! (little)
|
||
|
execute if entity @s[tag=Dying] run particle minecraft:lava ^ ^ ^-0.15 0 0 0 0.1 50
|
||
|
# summon fires!
|
||
|
execute if entity @s[tag=Dying] run function undeadm-m1:spawn/fire_blast_death
|
||
|
# play dead sound
|
||
|
execute if entity @s[tag=Dying] run playsound undeadm-m1:entity.fire_blast.die neutral @a
|
||
|
# die
|
||
|
execute if entity @s[tag=Dying] run kill @s
|
||
|
|
||
|
|
||
|
|