# Setting Data
data modify storage manic:storage root.temp.corpsebloom_state set from storage nucleus:storage root.temp.item.tag.manic.corpsebloom_state
execute if data storage nucleus:storage root.temp{hand_slot:0} run item replace entity @s[gamemode=!creative] weapon.mainhand with air
execute if data storage nucleus:storage root.temp{hand_slot:1} run item replace entity @s[gamemode=!creative] weapon.offhand with air

# Summon Entities
execute if entity @s[y_rotation=135..-135] run summon item_display ~ ~ ~ {Rotation:[0.0f,0.0f],Passengers:[{Tags:["nucleus.entity","nucleus.block","manic.tick","manic.second_clock","manic.corpsebloom","manic.corpseplant","smithed.block","manic.corpsebloom.start","manic.interaction_block"],response:true,id:"minecraft:interaction",width:0.75f,height:1.25f}],Tags:["manic.corpsebloom","manic.corpseplant","smithed.block"],transformation:{translation:[0.0f,0.75f,0.0f],left_rotation:[0.0f,0.0f,0.0f,1.0f],scale:[1.0f,1.0f,1.0f],right_rotation:[0.0f,0.0f,0.0f,1.0f]},item:{id:"minecraft:leather_boots",Count:1b,tag:{manic:{hits_to_break:3},CustomModelData:8360900,display:{color:16777215},Damage:20}},view_range:4.0}
execute if entity @s[y_rotation=-135..-45] run summon item_display ~ ~ ~ {Rotation:[90.0f,0.0f],Passengers:[{Tags:["nucleus.entity","nucleus.block","manic.tick","manic.second_clock","manic.corpsebloom","manic.corpseplant","smithed.block","manic.corpsebloom.start","manic.interaction_block"],response:true,id:"minecraft:interaction",width:0.75f,height:1.25f}],Tags:["manic.corpsebloom","manic.corpseplant","smithed.block"],transformation:{translation:[0.0f,0.75f,0.0f],left_rotation:[0.0f,0.0f,0.0f,1.0f],scale:[1.0f,1.0f,1.0f],right_rotation:[0.0f,0.0f,0.0f,1.0f]},item:{id:"minecraft:leather_boots",Count:1b,tag:{manic:{hits_to_break:3},CustomModelData:8360900,display:{color:16777215},Damage:20}},view_range:4.0}
execute if entity @s[y_rotation=-45..45] run summon item_display ~ ~ ~ {Rotation:[180.0f,0.0f],Passengers:[{Tags:["nucleus.entity","nucleus.block","manic.tick","manic.second_clock","manic.corpsebloom","manic.corpseplant","smithed.block","manic.corpsebloom.start","manic.interaction_block"],response:true,id:"minecraft:interaction",width:0.75f,height:1.25f}],Tags:["manic.corpsebloom","manic.corpseplant","smithed.block"],transformation:{translation:[0.0f,0.75f,0.0f],left_rotation:[0.0f,0.0f,0.0f,1.0f],scale:[1.0f,1.0f,1.0f],right_rotation:[0.0f,0.0f,0.0f,1.0f]},item:{id:"minecraft:leather_boots",Count:1b,tag:{manic:{hits_to_break:3},CustomModelData:8360900,display:{color:16777215},Damage:20}},view_range:4.0}
execute if entity @s[y_rotation=45..135] run summon item_display ~ ~ ~ {Rotation:[270.0f,0.0f],Passengers:[{Tags:["nucleus.entity","nucleus.block","manic.tick","manic.second_clock","manic.corpsebloom","manic.corpseplant","smithed.block","manic.corpsebloom.start","manic.interaction_block"],response:true,id:"minecraft:interaction",width:0.75f,height:1.25f}],Tags:["manic.corpsebloom","manic.corpseplant","smithed.block"],transformation:{translation:[0.0f,0.75f,0.0f],left_rotation:[0.0f,0.0f,0.0f,1.0f],scale:[1.0f,1.0f,1.0f],right_rotation:[0.0f,0.0f,0.0f,1.0f]},item:{id:"minecraft:leather_boots",Count:1b,tag:{manic:{hits_to_break:3},CustomModelData:8360900,display:{color:16777215},Damage:20}},view_range:4.0}

# Additional Effects
playsound manic:block.corpseplant.place block @a[distance=..16]
execute as @e[type=minecraft:interaction,tag=manic.corpsebloom.start,sort=nearest,limit=1,distance=..0.01] run function manic:block/corpsebloom/place/initiate
