Conditions:
  - score{objective=stage;v=1} true
  Skills:
  - effect:particles{p=enchantment_table;amount=2;hS=0.55;vS=1.4;speed=0;y=0.2;repeat=3;repeatInterval=5}
  - effect:particles{p=portal;amount=2;hS=0.6;vS=1.4;speed=0;y=0;repeat=3;repeatInterval=5}
 
BUG_HP_Herobrine-Spawner_Particle:
  Conditions:
  - mobsinradius{t=BUG_HP_Herobrine;a=0;r=60;action=TRUE}
  - mobsinradius{t=BUG_HP_Herobrine-Marker;a=0;r=60;action=TRUE}
  Skills:
  - effect:particles{particle=enchantment_table;amount=5;hS=0.5;vS=0.5;speed=-0.2;repeat=3;repeatInterval=5}
  - effect:particles{particle=portal;amount=5;hS=0.5;vS=0.5;speed=-0.2;repeat=3;repeatInterval=5}
 
BUG_HP_Herobrine_Damaged-0:
  Skills:
  - sound{s=entity.ender_dragon.hurt;p=0.8;v=1}
  - effect:particles{p=enchantment_table;amount=4;hS=0.55;vS=1.4;speed=0.2;y=0.2}
  - effect:particles{p=portal;amount=4;hS=0.6;vS=1.4;speed=0.2;y=0}
BUG_HP_Herobrine_Damaged-1:
  Skills:
  - sound{s=entity.ghast.scream;p=0.8;v=1}
  - potion{type=SLOW;duration=1;level=0;force=true;hasParticles=false}
  - modifymobscore{objective=stage;action=set;value=1} @Self
BUG_HP_Herobrine_Damaged-2:
  Skills:
  - CancelEvent
 
#_______________________________________________________________________________
#
#------------------------------+ ATTACK SKILLS +-------------------------------#
#_______________________________________________________________________________
 
BUG_HP_Herobrine_Attack-1:
  Cooldown: 12
  Skills:
  - modifymobscore{objective=skill;action=set;value=1} @Self
  - effect:lightning @self
  - summon{type=BUG_HP_Herobrine-Circle;radius=0} @Target
  - delay 5
  - potion{type=BLINDNESS;duration=60;level=4;force=true;hasParticles=false;hasIcon=false} @target
  - potion{type=CONFUSION;duration=120;level=4;force=true;hasParticles=false;hasIcon=false} @target
  - delay 5
  - teleport{spreadh=5;spreadv=0} @Target
  - sound{s=entity.enderman.teleport;p=0.8;v=2} @self
  - effect:particles{p=enchantment_table;amount=30;hS=0.5;vS=1;speed=0.05;y=1} @self
  - effect:particles{p=portal;amount=15;hS=1;vS=1;y=1;speed=0;repeat=2;repeatInterval=5} @origin
  - potion{type=SPEED;duration=50;level=4;force=true;hasParticles=false} @self
  - delay 100
  - modifymobscore{objective=skill;action=set;value=0} @Self
 
BUG_HP_Herobrine_Attack-2:
  Cooldown: 15
  Skills:
  - modifymobscore{objective=skill;action=set;value=1} @Self
  - sound{s=entity.wither.shoot;p=0.3} @self
  - missile{oT=BUG_HP_Herobrine_Attack-2_Tick;oH=BUG_HP_Herobrine_Attack-2_Hit;v=4;i=1;hR=1;vR=1;mr=18} @Target
  - delay 150
  - modifymobscore{objective=skill;action=set;value=0} @Self
BUG_HP_Herobrine_Attack-2_Hit:
  Skills:
  - damage{a=16} @PlayersNearOrigin{r=2}
  - effect:sound{s=block.fire.extinguish;v=1;p=0.5} @PIR{r=6}
  - potion{type=CONFUSION;duration=120;level=1;force=true;hasParticles=false;hasIcon=false} @PlayersNearOrigin{r=2}
  - potion{type=SLOW;duration=120;level=1;force=true;hasParticles=false;hasIcon=false} @PlayersNearOrigin{r=2}
  - effect:particles{p=fireworks_spark;amount=8;hS=1;vS=1;speed=0.01;y=0.2;repeat=23;repeatInterval=5} @PlayersNearOrigin{r=2}
  - effect:particles{p=portal;amount=8;hS=1;vS=1;speed=0.01;y=0.2;repeat=19;repeatInterval=5} @PlayersNearOrigin{r=2}
BUG_HP_Herobrine_Attack-2_Tick:
  Skills:
  - effect:particles{p=fireworks_spark;amount=1;hSpread=0.1;vSpread=0.1;speed=0.1;yOffset=0} @origin
  - delay 1
  - effect:particles{p=enchantment_table;amount=2;hSpread=0.1;vSpread=0.1;speed=0.1;yOffset=0} @origin
 
BUG_HP_Herobrine_Attack-3:
  Conditions:
  - score{objective=distance2;v=1}
  Skills:
  - modifymobscore{objective=skill;action=set;value=1} @Self
  - potion{type=SLOW;duration=50;level=10;force=true;hasParticles=false} @self
  - delay 20
  - sound{s=entity.arrow.shoot;p=1;repeat=3;repeatinterval=10} @self
  - projectile{oT=BUG_HP_Herobrine_Attack-3_Tick;oH=BUG_HP_Herobrine_Attack-3_Hit;oE=BUG_HP_Herobrine_Attack-3_End;v=20;i=1;hR=1;vR=1.5;mr=30;g=0.05;syo=1.7;tyo=0.8;repeat=2;repeatinterval=10} @Target
  - delay 130
  - modifymobscore{objective=skill;action=set;value=0} @Self
BUG_HP_Herobrine_Attack-3_Hit:
  Skills:
  - effect:particles{particle=fireworks_spark;amount=6;hS=0.5;vS=0.5;speed=0.01;y=1} @target
  - damage{a=15;ia=false} @target
BUG_HP_Herobrine_Attack-3_Tick:
  Skills:
  - effect:particles{p=crit;amount=1;hSpread=0.1;vSpread=0.1;speed=0.1;yOffset=0} @origin
  - delay 1
  - effect:particles{p=enchantment_table;amount=2;hSpread=0.1;vSpread=0.1;speed=0.1;yOffset=0} @origin
BUG_HP_Herobrine_Attack-3_End:
  Skills:
  - effect:particles{p=fireworks_spark;amount=5;speed=0.04;hs=0.4;vs=0} @origin
  - sound{s=entity.arrow.hit;p=1} @origin
 
#_______________________________________________________________________________
#
#-------------------------------+ OTHER SKILLS +-------------------------------#
#_______________________________________________________________________________
 
BUG_HP_Herobrine_Distance-Checker:
  Cooldown: 2
  Conditions:
  - score{objective=skill;v=0} true
  - score{objective=stage;v=1} true
  - playerwithin{d=40}
  Skills:
  - skill{s=BUG_HP_Herobrine_Distance-Near}
  - skill{s=BUG_HP_Herobrine_Distance-Far}
  - delay 10
  - skill{s=BUG_HP_Herobrine_isNear} @Self
  - skill{s=BUG_HP_Herobrine_isFar} @Self
BUG_HP_Herobrine_Distance-Near:
  Conditions:
  - targetwithin{d=8}
  Skills:
  - modifymobscore{objective=distance;action=set;value=0} @Self