Initial Commit
This commit is contained in:
23
data/serenitydeco/function/setup_deco.mcfunction
Normal file
23
data/serenitydeco/function/setup_deco.mcfunction
Normal file
@@ -0,0 +1,23 @@
|
||||
# Summon origin point to parent all other entities (excluding triggerbox)
|
||||
$summon interaction ~ ~ ~ {width:0,height:0,Tags:[serenitydeco_origin],data:{deco_id:$(deco_id)}}
|
||||
|
||||
# Spawn deco model & hitbox
|
||||
$function serenitydeco:spawn/$(deco_id)
|
||||
$summon interaction ~ ~ ~ {width:$(deco_width),height:$(deco_height),Tags:[serenitydeco_triggerbox]}
|
||||
|
||||
# Remove armor stand
|
||||
kill @n[type=armor_stand,predicate=serenitydeco:is_wearing_deco]
|
||||
|
||||
# Tag all of the model entities
|
||||
execute as @n[tag=serenitydeco_parent,distance=..2] on passengers run tag @s add serenitydeco_part
|
||||
|
||||
# Rotate deco
|
||||
execute as @e[tag=serenitydeco_part,distance=..2] positioned as @s facing entity @p feet run rotate @s ~ 0
|
||||
|
||||
# Dismount and remount all model entities
|
||||
execute as @e[tag=serenitydeco_part,distance=..2] run ride @s dismount
|
||||
execute as @e[tag=serenitydeco_part,distance=..2] run ride @s mount @n[tag=serenitydeco_origin,distance=..2]
|
||||
ride @n[tag=serenitydeco_parent,distance=..2] mount @n[tag=serenitydeco_origin,distance=..2]
|
||||
|
||||
# Remove tagging
|
||||
execute as @n[tag=serenitydeco_origin,distance=..2] on passengers run tag @s remove serenitydeco_part
|
||||
Reference in New Issue
Block a user