Sorin Lewis

create me a datapack that changes the elder guardian with a stronger version, it should have 150 hp, the ability to summon normal guardians with 20 hp, and a blue bossbar

Kodari AI
KodariSep 6 at 4:30 am 1
ElderGuardianOverhaul
Overhauls the Elder Guardian into a formidable boss. It possesses 150 health points and displays a blue boss bar for tracking. The enhanced Elder Guardian periodically summons regular Guardians, each with 20 health points, to assist in combat. This datapack modifies the vanilla Elder Guardian's attributes and adds custom summoning behavior through a scoreboard timer system, creating a more challenging underwater boss encounter.

Download the ZIP using the export button, then:

  1. Extract enhanced_elder_guardian_datapack into world/datapacks/.

  2. Run /reload.

  3. Verify it loaded with /datapack list.

  4. Test it with /function enhanced_elder_guardian:test.

  5. The elder guardian will have 150 HP, summon guardians with 20 HP every 10 seconds, and display a blue bossbar within 64 blocks.

Kodari can make mistakes. Review important code before using.
Files
enhanced_elder_guardian_datapack
Code
10 43
enhanced_elder_guardian_datapack/data/enhanced_elder_guardian/function/elder_guardian.mcfunction
execute unless entity @s[tag=enhanced_elder_guardian] run attribute @s minecraft:generic.max_health base set 150
execute unless entity @s[tag=enhanced_elder_guardian] run data merge entity @s {Health:150.0f}
execute unless entity @s[tag=enhanced_elder_guardian] run scoreboard players set @s enhanced_elder_guardian_timer 0
tag @s add enhanced_elder_guardian
scoreboard players add @s enhanced_elder_guardian_timer 1
execute if score @s enhanced_elder_guardian_timer matches 200.. run function enhanced_elder_guardian:summon_guardian
execute if score @s enhanced_elder_guardian_timer matches 200.. run scoreboard players set @s enhanced_elder_guardian_timer 0