package totemic_commons.pokefenn.ceremony;

import net.minecraft.util.BlockPos;
import net.minecraft.util.EnumFacing;
import net.minecraft.world.World;
import totemic_commons.pokefenn.api.ceremony.Ceremony;
import totemic_commons.pokefenn.api.music.MusicInstrument;
import totemic_commons.pokefenn.entity.boss.EntityBaykok;
import totemic_commons.pokefenn.util.EntityUtil;

public class CeremonyBaykok extends Ceremony
{
    public CeremonyBaykok(String name, int musicNeeded, int maxStartupTime, MusicInstrument... instruments)
    {
        super(name, musicNeeded, maxStartupTime, instruments);
    }

    @Override
    public void effect(World world, BlockPos pos, int time)
    {
        if(world.isRemote || time != getEffectTime() - 1)
            return;

        world.playBroadcastSound(1013, pos, 0); //Wither spawn sound
        BlockPos spos = pos.offset(EnumFacing.getHorizontal(world.rand.nextInt(4)));
        EntityUtil.spawnEntity(world, spos.getX() + 0.5, spos.getY(), spos.getZ() + 0.5, new EntityBaykok(world));
    }

    @Override
    public int getEffectTime()
    {
        return 3 * 20;
    }
}

@@ -320,57 +320,8 @@
 kok;
-%0Aimport totemic_commons.pokefenn.util.EntityUtil;
 %0A%0Apu
@@ -880,106 +880,242 @@
 tity
-Util.spawnEntity(world, spos.getX() + 0.5, spos.getY(), spos.getZ() + 0.5, new EntityBaykok(world)
+Baykok baykok = new EntityBaykok(world);%0A        baykok.setPosition(spos.getX() + 0.5, spos.getY(), spos.getZ() + 0.5);%0A        baykok.onInitialSpawn(world.getDifficultyForLocation(spos), null);%0A        world.spawnEntityInWorld(baykok
 );%0A 
@@ -1186,17 +1186,17 @@
  return 
-3
+4
  * 20;%0A 

Fix Baykok spawning without his bow