execute unless score bloodmoon Insomnia matches 1.. unless score hardmode hardmode matches 1 unless entity @e[tag=boogie,distance=..20] unless entity @e[type=villager,distance=..3] run summon drowned ~ ~ ~ {IsBaby:1b,CanBreakDoors:1b,CustomName:{"text":"The Boogeyman"},Health:20,Tags:[plussed,boogie,blood,rare],active_effects:[{id:invisibility,duration:-1,show_particles:0b},{id:weakness,duration:60,amplifier:0b}],equipment:{legs:{id:potion,components:{custom_data:{ghostpot:tag},potion_contents:{custom_color:11896286},custom_name:{"text":"Vial of Phantom","italic":false},lore:[{"text":"Ghost Form (0:30)","italic":false,"color":"blue"}],rarity:epic,tooltip_display:{hidden_components:[potion_contents]}}},head:{id:chainmail_helmet}},drop_chances:{head:0f,legs:.15f},attributes:[{id:knockback_resistance,base:0.6f},{id:movement_speed,base:0.2f},{id:max_health,base:20f},{id:attack_damage,base:5f}],DeathLootTable:""}
execute unless score bloodmoon Insomnia matches 1.. if score hardmode hardmode matches 1 unless entity @e[tag=boogie,distance=..20] unless entity @e[type=villager,distance=..3] run summon husk ~ ~ ~ {IsBaby:0b,CanBreakDoors:1b,CustomName:{"text":"The Bigger Boogey"},Health:30,Tags:[plussed,boogie,blood,rare],active_effects:[{id:invisibility,duration:-1,show_particles:0b},{id:weakness,duration:60,amplifier:0b}],equipment:{legs:{id:potion,components:{custom_data:{ghostpot:tag},potion_contents:{custom_color:11896286},custom_name:{"text":"Vial of Phantom","italic":false},lore:[{"text":"Ghost Form (0:30)","italic":false,"color":"blue"}],rarity:epic,tooltip_display:{hidden_components:[potion_contents]}}},chest:{id:leather_chestplate,components:{dyed_color:0}},head:{id:leather_helmet,components:{dyed_color:0}}},drop_chances:{legs:.3f,chest:0f,head:0f},attributes:[{id:knockback_resistance,base:0.8f},{id:movement_speed,base:0.23f},{id:max_health,base:30f},{id:attack_damage,base:7f}],DeathLootTable:""}
execute unless score bloodmoon Insomnia matches 1.. at @n[tag=boogie,distance=..20] run playsound minecraft:entity.shulker.ambient hostile @a ~ ~ ~ 2 0
tp @s ~ ~ ~
title @s actionbar {"text": "You may not rest now; there are monsters nearby"}