execute if score #anniR_global anniR_difficulty matches 0 run summon magma_cube ~ ~ ~ {DeathLootTable:"minecraft:empty",PersistenceRequired:1b,Health:20f,Size:2,Tags:["anni_immune","anni_summoned"],Attributes:[{Name:generic.max_health,Base:20},{Name:generic.knockback_resistance,Base:10},{Name:generic.attack_damage,Base:12},{Name:generic.armor,Base:5},{Name:generic.armor_toughness,Base:2},{Name:generic.attack_knockback,Base:1},{Name:generic.follow_range,Base:100}]}
execute if score #anniR_global anniR_difficulty matches 1 run summon magma_cube ~ ~ ~ {DeathLootTable:"minecraft:empty",PersistenceRequired:1b,Health:32f,Size:2,Tags:["anni_immune","anni_summoned"],Attributes:[{Name:generic.max_health,Base:32},{Name:generic.knockback_resistance,Base:10},{Name:generic.attack_damage,Base:18},{Name:generic.armor,Base:10},{Name:generic.armor_toughness,Base:2},{Name:generic.attack_knockback,Base:1},{Name:generic.follow_range,Base:100}]}
execute if score #anniR_global anniR_difficulty matches 2 run summon magma_cube ~ ~ ~ {DeathLootTable:"minecraft:empty",PersistenceRequired:1b,Health:52f,Size:2,Tags:["anni_immune","anni_summoned"],Attributes:[{Name:generic.max_health,Base:52},{Name:generic.knockback_resistance,Base:10},{Name:generic.attack_damage,Base:24},{Name:generic.armor,Base:15},{Name:generic.armor_toughness,Base:2},{Name:generic.attack_knockback,Base:1},{Name:generic.follow_range,Base:100}]}

execute if score #anniR_global anniR_team matches 1 run team join annihilation_team @e[type=magma_cube,tag=anni_immune,tag=!anni_hitbox,tag=anni_summoned,distance=..0,limit=1,sort=nearest]