Jump to content

[1.7.10] Melee and Range Hybrid Tameable Wolf help


NovaViper

Recommended Posts

Hey I need some help with my creature im trying to make. I'm trying to make attack creatures with melee and then attack with a ranged attack and apply a cooldown for the ranged attack. I got it to shoot stuff but it engage in melee mode; which is leaping at a target and attacking like a vanilla wolf. What am I doing wrong here?

 

Sorry for the code being long

 

import java.util.List;

import net.minecraft.block.Block;
import net.minecraft.block.BlockColored;
import net.minecraft.block.material.Material;
import net.minecraft.enchantment.EnchantmentHelper;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityAgeable;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.IRangedAttackMob;
import net.minecraft.entity.SharedMonsterAttributes;
import net.minecraft.entity.ai.EntityAIArrowAttack;
import net.minecraft.entity.ai.EntityAIAttackOnCollide;
import net.minecraft.entity.ai.EntityAIHurtByTarget;
import net.minecraft.entity.ai.EntityAILeapAtTarget;
import net.minecraft.entity.ai.EntityAILookIdle;
import net.minecraft.entity.ai.EntityAIMate;
import net.minecraft.entity.ai.EntityAISwimming;
import net.minecraft.entity.ai.EntityAIWander;
import net.minecraft.entity.ai.EntityAIWatchClosest;
import net.minecraft.entity.monster.EntityCreeper;
import net.minecraft.entity.monster.EntityGhast;
import net.minecraft.entity.passive.EntityAnimal;
import net.minecraft.entity.passive.EntityHorse;
import net.minecraft.entity.passive.EntitySheep;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.projectile.EntityArrow;
import net.minecraft.entity.projectile.EntitySnowball;
import net.minecraft.init.Blocks;
import net.minecraft.init.Items;
import net.minecraft.item.ItemFood;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.pathfinding.PathEntity;
import net.minecraft.potion.PotionEffect;
import net.minecraft.util.AxisAlignedBB;
import net.minecraft.util.DamageSource;
import net.minecraft.util.MathHelper;
import net.minecraft.world.World;
import common.zeroquest.ModAchievements;
import common.zeroquest.ModItems;
import common.zeroquest.entity.ai.EntityCustomIZAIBeg;
import common.zeroquest.entity.ai.tameable.EntityCustomAIFollowOwner;
import common.zeroquest.entity.ai.tameable.EntityCustomAIOwnerHurtByTarget;
import common.zeroquest.entity.ai.tameable.EntityCustomAIOwnerHurtTarget;
import common.zeroquest.entity.ai.tameable.EntityCustomAITargetNonTamed;
import common.zeroquest.lib.Constants;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;

public class EntityIceZertum extends EntityCustomTameable implements IRangedAttackMob
{   
    /**
     * This time increases while wolf is shaking and emitting water particles.
     */
    
    private float field_70926_e;
    private float field_70924_f;
    /** true is the wolf is wet else false */
    private boolean isShaking;
    private boolean field_70928_h;
    /**
     * This time increases while wolf is shaking and emitting water particles.
     */
    private float timeWolfIsShaking;
    private float prevTimeWolfIsShaking;
    private static final String __OBFID = "CL_00001654";
    public int rare;
    //public InventoryPack inventory;
    private boolean canSeeCreeper;
    
    public static final double maxHealth = 35;
    public static final double attackDamage = 6;
    public static final double speed = 0.4;
    public static final double maxHealthTamed = 40;
    public static final double attackDamageTamed = 8;
    public static final double maxHealthBaby = 10;
    public static final double attackDamageBaby = 4;
private int timer;

    public EntityIceZertum(World p_i1696_1_)
    {
        super(p_i1696_1_);
        this.setSize(0.6F, 0.8F);
        this.getNavigator().setAvoidsWater(true);
        this.tasks.addTask(1, new EntityAISwimming(this));
        this.tasks.addTask(2, this.aiCSit);
        this.tasks.addTask(3, new EntityAILeapAtTarget(this, 0.4F));
        this.tasks.addTask(4, new EntityAIAttackOnCollide(this, 1.0D, true));
        this.tasks.addTask(5, new EntityCustomAIFollowOwner(this, 1.0D, 10.0F, 2.0F));
        this.tasks.addTask(6, new EntityAIMate(this, 1.0D));
        this.tasks.addTask(7, new EntityAIWander(this, 1.0D));
        this.tasks.addTask(8, new EntityCustomIZAIBeg(this, 8.0F));
        this.tasks.addTask(9, new EntityAIWatchClosest(this, EntityPlayer.class, 8.0F));
        this.tasks.addTask(9, new EntityAILookIdle(this));
	this.tasks.addTask(3, new EntityAIArrowAttack(this, 0.4, 60, 10.0F));
        this.targetTasks.addTask(1, new EntityCustomAIOwnerHurtByTarget(this));
        this.targetTasks.addTask(2, new EntityCustomAIOwnerHurtTarget(this));
        this.targetTasks.addTask(3, new EntityAIHurtByTarget(this, true));
        this.targetTasks.addTask(4, new EntityCustomAITargetNonTamed(this, EntitySheep.class, 200, false));
        this.setTamed(false);
        //this.inventory = new InventoryPack(this);
    }

    protected void applyEntityAttributes()
    {
        super.applyEntityAttributes();
        this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(maxHealth);
        this.getEntityAttribute(SharedMonsterAttributes.attackDamage).setBaseValue(attackDamage);
        this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(speed);

        if (this.isTamed())
        {
            this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(maxHealthTamed);
            this.getEntityAttribute(SharedMonsterAttributes.attackDamage).setBaseValue(attackDamageTamed);
        }
        else if (this.isChild())
        {
            this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(maxHealthBaby);
            this.getEntityAttribute(SharedMonsterAttributes.attackDamage).setBaseValue(attackDamageBaby);
        }
    }

    /**
     * Returns true if the newer Entity AI code should be run
     */
    public boolean isAIEnabled()
    {
        return true;
    }

    /**
     * Sets the active target the Task system uses for tracking
     */
    public void setAttackTarget(EntityLivingBase p_70624_1_)
    {
        super.setAttackTarget(p_70624_1_);

        if (p_70624_1_ == null)
        {
            this.setAngry(false);
        }
        else if (!this.isTamed())
        {
            this.setAngry(true);
        }
    }

    /**
     * main AI tick function, replaces updateEntityActionState
     */
    protected void updateAITick()
    {
        this.dataWatcher.updateObject(18, Float.valueOf(this.getHealth()));
    }

    protected void entityInit()
    {
        super.entityInit();
        this.dataWatcher.addObject(18, new Float(this.getHealth()));
        this.dataWatcher.addObject(19, new Byte((byte)0));
        this.dataWatcher.addObject(20, new Byte((byte)BlockColored.func_150032_b(1)));
    }

    protected void func_145780_a(int p_145780_1_, int p_145780_2_, int p_145780_3_, Block p_145780_4_)
    {
        this.playSound("mob.wolf.step", 0.15F, 1.0F);
    }

    /**
     * (abstract) Protected helper method to write subclass entity data to NBT.
     */
    public void writeEntityToNBT(NBTTagCompound p_70014_1_)
    {
        super.writeEntityToNBT(p_70014_1_);
        p_70014_1_.setBoolean("Angry", this.isAngry());
        p_70014_1_.setByte("CollarColor", (byte)this.getCollarColor());
    }

    /**
     * (abstract) Protected helper method to read subclass entity data from NBT.
     */
    public void readEntityFromNBT(NBTTagCompound p_70037_1_)
    {
        super.readEntityFromNBT(p_70037_1_);
        this.setAngry(p_70037_1_.getBoolean("Angry"));

        if (p_70037_1_.hasKey("CollarColor", 99))
        {
            this.setCollarColor(p_70037_1_.getByte("CollarColor"));
        }
    }

    /**
     * Returns the sound this mob makes while it's alive.
     */
    protected String getLivingSound()
    {
        return this.canSeeCreeper ? "mob.wolf.growl" : this.isAngry() ? "mob.wolf.growl" : 
        	(this.rand.nextInt(3) == 0 ? 
        			(this.isTamed() && this.getHealth() < 10.0F ? "mob.wolf.whine"
        					: "mob.wolf.panting")
        					: "mob.wolf.bark");
    }

    /**
     * Returns the sound this mob makes when it is hurt.
     */
    protected String getHurtSound()
    {
        return "mob.wolf.hurt";
    }

    /**
     * Returns the sound this mob makes on death.
     */
    protected String getDeathSound()
    {
        return "mob.wolf.death";
    }

    /**
     * Returns the volume for the sounds this mob makes.
     */
    protected float getSoundVolume()
    {
        return 0.5F;
    }

    /**
     * Get number of ticks, at least during which the living entity will be silent.
     */
@Override
    public int getTalkInterval() {
    	if(this.canSeeCreeper){
    		return 40;
    	}else if(this.getHealth() <=10){
    		return 20;
    	}else{
    		return 200;
    	}
    }
    
    /**
     * Returns the item ID for the item the mob drops on death.
     */
    protected void dropFewItems(boolean par1, int par2)
    {
        rare = rand.nextInt(20);
            {
                if (this.isBurning())
                {
                    this.dropItem(ModItems.zertumMeatCooked, 1);
                }
                else if (rare <= 12)
                {
                    this.dropItem(ModItems.zertumMeatRaw, 1);
                }
                if(rare <= 6 && !this.isTamed())
                {
                	this.dropItem(ModItems.nileGrain, 1);
                }
                /*if(rare >= 17)
                {
                	this.dropItem(ModItems.nileDust.itemID, 1);
                }*/
                else
                {
                	
                }
                
            }
        }

    /**
     * Called frequently so the entity can update its state every tick as required. For example, zombies and skeletons
     * use this to react to sunlight and start to burn.
     */
    public void onLivingUpdate()
    {
	if (!this.worldObj.isRemote && this.timer > 0) {
		timer--;
	}
    	
        super.onLivingUpdate();       
      	double d0 = this.rand.nextGaussian() * 0.04D;
    	double d1 = this.rand.nextGaussian() * 0.04D;
    	double d2 = this.rand.nextGaussian() * 0.04D;
    	worldObj.spawnParticle("snowshovel", this.posX + (double)(this.rand.nextFloat() * this.width * 2.0F) - (double)this.width, this.posY + 0.5D + (double)(this.rand.nextFloat() * this.height), this.posZ + (double)(this.rand.nextFloat() * this.width * 2.0F) - (double)this.width, d0, d1, d2);
    	
    	for (int l = 0; l < 4; ++l)
        {
            int i = MathHelper.floor_double(this.posX + (double)((float)(l % 2 * 2 - 1) * 0.25F));
            int j = MathHelper.floor_double(this.posY);
            int k = MathHelper.floor_double(this.posZ + (double)((float)(l / 2 % 2 * 2 - 1) * 0.25F));

            if (this.worldObj.getBlock(i, j, k).getMaterial() == Material.air && Blocks.snow_layer.canPlaceBlockAt(this.worldObj, i, j, k))
            {
                this.worldObj.setBlock(i, j, k, Blocks.snow_layer);
            }
            if (this.worldObj.getBlock(i, j, k).getMaterial() == Material.water && Blocks.ice.canPlaceBlockAt(this.worldObj, i, j, k))
            {
                this.worldObj.setBlock(i, j, k, Blocks.ice);
            }
        }

        if (!this.worldObj.isRemote && this.isShaking && !this.field_70928_h && !this.hasPath() && this.onGround)
        {
            this.field_70928_h = true;
            this.timeWolfIsShaking = 0.0F;
            this.prevTimeWolfIsShaking = 0.0F;
            this.worldObj.setEntityState(this, (byte);
        }
        
        if(this.entityToAttack != null && this.entityToAttack.isDead) {
            this.entityToAttack = null;
        }
        
        if(Constants.DEF_HEALING == true && !this.isChild() && this.getHealth() <=10 && this.isTamed())
        {
       		this.addPotionEffect(new PotionEffect(10, 200));
        }
        
        if (this.getAttackTarget() == null && isTamed() && 15 > 0) {
            List list1 = worldObj.getEntitiesWithinAABB(EntityCreeper.class, AxisAlignedBB.getBoundingBox(posX, posY, posZ, posX + 1.0D, posY + 1.0D, posZ + 1.0D).expand(sniffRange(), 4D, sniffRange()));

            if (!list1.isEmpty() && !isSitting() && this.getHealth() > 1 && !this.isChild()) { //TODO
                canSeeCreeper = true;
              	double d3 = 0.5D + this.rand.nextGaussian() * 0.04D;
            	double d4 = 0.0D + this.rand.nextGaussian() * 0.04D;
            	double d5 = 0.0D + this.rand.nextGaussian() * 0.04D;
            	worldObj.spawnParticle("reddust", this.posX + (double)(this.rand.nextFloat() * this.width * 2.0F) - (double)this.width, this.posY + 0.5D + (double)(this.rand.nextFloat() * this.height), this.posZ + (double)(this.rand.nextFloat() * this.width * 2.0F) - (double)this.width, d3, d4, d5);
            }
            else {
                canSeeCreeper = false;
            }
        }
    }
    

    public double sniffRange(){
        double d = 0.0D;
        for (int i = 0; i < 15 * 6; i++)
        {
            d++;
        }
        return d;
    }

    /**
     * Called to update the entity's position/logic.
     */
    public void onUpdate()
    {
        super.onUpdate(); 
        this.field_70924_f = this.field_70926_e;

        if (this.func_70922_bv())
        {
            this.field_70926_e += (1.0F - this.field_70926_e) * 0.4F;
        }
        else
        {
            this.field_70926_e += (0.0F - this.field_70926_e) * 0.4F;
        }

        if (this.func_70922_bv())
        {
            this.numTicksToChaseTarget = 10;
        }

        if (this.isWet())
        {
            this.isShaking = true;
            this.field_70928_h = false;
            this.timeWolfIsShaking = 0.0F;
            this.prevTimeWolfIsShaking = 0.0F;
        }
        else if ((this.isShaking || this.field_70928_h) && this.field_70928_h)
        {
            if (this.timeWolfIsShaking == 0.0F)
            {
                this.playSound("mob.wolf.shake", this.getSoundVolume(), (this.rand.nextFloat() - this.rand.nextFloat()) * 0.2F + 1.0F);
            }

            this.prevTimeWolfIsShaking = this.timeWolfIsShaking;
            this.timeWolfIsShaking += 0.05F;

            if (this.prevTimeWolfIsShaking >= 2.0F)
            {
                this.isShaking = false;
                this.field_70928_h = false;
                this.prevTimeWolfIsShaking = 0.0F;
                this.timeWolfIsShaking = 0.0F;
            }

            if (this.timeWolfIsShaking > 0.4F)
            {
                float f = (float)this.boundingBox.minY;
                int i = (int)(MathHelper.sin((this.timeWolfIsShaking - 0.4F) * (float)Math.PI) * 7.0F);

                for (int j = 0; j < i; ++j)
                {
                    float f1 = (this.rand.nextFloat() * 2.0F - 1.0F) * this.width * 0.5F;
                    float f2 = (this.rand.nextFloat() * 2.0F - 1.0F) * this.width * 0.5F;
                    this.worldObj.spawnParticle("splash", this.posX + (double)f1, (double)(f + 0.8F), this.posZ + (double)f2, this.motionX, this.motionY, this.motionZ);
                }
            }
        }
    }

    @SideOnly(Side.CLIENT)
    public boolean getWolfShaking()
    {
        return this.isShaking;
    }

    /**
     * Used when calculating the amount of shading to apply while the wolf is shaking.
     */
    @SideOnly(Side.CLIENT)
    public float getShadingWhileShaking(float p_70915_1_)
    {
        return 0.75F + (this.prevTimeWolfIsShaking + (this.timeWolfIsShaking - this.prevTimeWolfIsShaking) * p_70915_1_) / 2.0F * 0.25F;
    }

    @SideOnly(Side.CLIENT)
    public float getShakeAngle(float p_70923_1_, float p_70923_2_)
    {
        float f2 = (this.prevTimeWolfIsShaking + (this.timeWolfIsShaking - this.prevTimeWolfIsShaking) * p_70923_1_ + p_70923_2_) / 1.8F;

        if (f2 < 0.0F)
        {
            f2 = 0.0F;
        }
        else if (f2 > 1.0F)
        {
            f2 = 1.0F;
        }

        return MathHelper.sin(f2 * (float)Math.PI) * MathHelper.sin(f2 * (float)Math.PI * 11.0F) * 0.15F * (float)Math.PI;
    }

    public float getEyeHeight()
    {
        return this.height * 0.8F;
    }

    @SideOnly(Side.CLIENT)
    public float getInterestedAngle(float p_70917_1_)
    {
        return (this.field_70924_f + (this.field_70926_e - this.field_70924_f) * p_70917_1_) * 0.15F * (float)Math.PI;
    }

    /**
     * The speed it takes to move the entityliving's rotationPitch through the faceEntity method. This is only currently
     * use in wolves.
     */
    public int getVerticalFaceSpeed()
    {
        return this.isSitting() ? 20 : super.getVerticalFaceSpeed();
    }

    /**
     * Called when the entity is attacked.
     */
    public boolean attackEntityFrom(DamageSource p_70097_1_, float p_70097_2_)
    {
        if (this.isEntityInvulnerable())
        {
            return false;
        }
        else
        {
            Entity entity = p_70097_1_.getEntity();
            this.aiCSit.setSitting(false);

            if (entity != null && !(entity instanceof EntityPlayer) && !(entity instanceof EntityArrow))
            {
                p_70097_2_ = (p_70097_2_ + 1.0F) / 2.0F;
            }

            return super.attackEntityFrom(p_70097_1_, p_70097_2_);
        }
    }

    public boolean attackEntityAsMob(Entity par1Entity)
    {
        float f = (float)this.getEntityAttribute(SharedMonsterAttributes.attackDamage).getAttributeValue();
        int i = 0;

        if (par1Entity instanceof EntityLivingBase)
        {
            f += EnchantmentHelper.getEnchantmentModifierLiving(this, (EntityLivingBase)par1Entity);
            i += EnchantmentHelper.getKnockbackModifier(this, (EntityLivingBase)par1Entity);
            
        }

        boolean flag = par1Entity.attackEntityFrom(DamageSource.causeMobDamage(this), f);

        if (flag)
        {
            if (i > 0)
            {
                par1Entity.addVelocity((double)(-MathHelper.sin(this.rotationYaw * (float)Math.PI / 180.0F) * (float)i * 0.5F), 0.1D, (double)(MathHelper.cos(this.rotationYaw * (float)Math.PI / 180.0F) * (float)i * 0.5F));
                this.motionX *= 0.6D;
                this.motionZ *= 0.6D;
            }
        }
	return flag;
    }
    
@Override
public void attackEntityWithRangedAttack(EntityLivingBase p_82196_1_, float p_82196_2_) { //TODO ranged attack
	if (timer == 0) {
        EntitySnowball entitysnowball = new EntitySnowball(this.worldObj, this);
        double d0 = p_82196_1_.posX - this.posX;
        double d1 = p_82196_1_.posY + (double)p_82196_1_.getEyeHeight() - 1.100000023841858D - entitysnowball.posY;
        double d2 = p_82196_1_.posZ - this.posZ;
        float f1 = MathHelper.sqrt_double(d0 * d0 + d2 * d2) * 0.2F;
        entitysnowball.setThrowableHeading(d0, d1 + (double)f1, d2, 1.6F, 12.0F);
        this.playSound("random.bow", 1.0F, 1.0F / (this.getRNG().nextFloat() * 0.4F + 0.8F));
        this.worldObj.spawnEntityInWorld(entitysnowball);
		timer = 250;

	} else {
         this.tasks.addTask(3, new EntityAILeapAtTarget(this, 0.4F));
		 this.attackEntity(p_82196_1_, p_82196_2_);
		 this.attackEntityAsMob(p_82196_1_);
	}
}
    
    /**
     * Called when the mob's health reaches 0.
     */
    public void onDeath(DamageSource par1DamageSource)
    {
        super.onDeath(par1DamageSource);

        if (par1DamageSource.getEntity() instanceof EntityPlayer)
        {
            EntityPlayer entityplayer = (EntityPlayer)par1DamageSource.getEntity();
            {
                //entityplayer.triggerAchievement(ModAchievements.ZertKill); TODO achievement
                //this.dropChestItems(); TODO Inventory
                
            }
        }
    }
    
    /*public void dropChestItems() TODO Inventory
    {
        this.dropItemsInChest(this, this.inventory);
    }
    
    private void dropItemsInChest(Entity par1Entity, InventoryPack inventory2)
    {
        if (inventory2 != null && !this.worldObj.isRemote)
        {
            for (int i = 0; i < inventory2.getSizeInventory(); ++i)
            {
                ItemStack itemstack = inventory2.getStackInSlot(i);

                if (itemstack != null)
                {
                    this.entityDropItem(itemstack, 0.0F);
                }
            }
        }
    }*/

    /**
     * Called when a player interacts with a mob. e.g. gets milk from a cow, gets into the saddle on a pig.
     */
    public boolean interact(EntityPlayer par1EntityPlayer)
    {
        ItemStack itemstack = par1EntityPlayer.inventory.getCurrentItem();

        if (this.isTamed())
        {
            if (itemstack != null)
            {
                if (itemstack.getItem() instanceof ItemFood)
                {
                    ItemFood itemfood = (ItemFood)itemstack.getItem();

                    if (itemfood.isWolfsFavoriteMeat() && this.dataWatcher.getWatchableObjectFloat(18) < 20.0F)
                    {
                        if (!par1EntityPlayer.capabilities.isCreativeMode)
                        {
                            --itemstack.stackSize;
                        }

                        this.heal((float)itemfood.func_150905_g(itemstack));

                        if (itemstack.stackSize <= 0)
                        {
                            par1EntityPlayer.inventory.setInventorySlotContents(par1EntityPlayer.inventory.currentItem, (ItemStack)null);
                        }

                        return true;
                    }
                }
                /*else if(itemstack.getItem() == Items.stick && canInteract(par1EntityPlayer)) TODO Inventory
                {
                 par1EntityPlayer.openGui(ZeroQuest.instance, CommonProxy.IceZertumPack, this.worldObj, this.getEntityId(), MathHelper.floor_double(this.posY), MathHelper.floor_double(this.posZ));
                 return true;
                }*/
                else if (itemstack.getItem() == Items.dye)
                {
                    int i = BlockColored.func_150032_b(itemstack.getItemDamage());

                    if (i != this.getCollarColor())
                    {
                        this.setCollarColor(i);

                        if (!par1EntityPlayer.capabilities.isCreativeMode && --itemstack.stackSize <= 0)
                        {
                            par1EntityPlayer.inventory.setInventorySlotContents(par1EntityPlayer.inventory.currentItem, (ItemStack)null);
                        }

                        return true;
                    }
                }
            }

            if (canInteract(par1EntityPlayer) && isServer() && !this.isBreedingItem(itemstack))
            {
                this.aiCSit.setSitting(!this.isSitting());
                this.isJumping = false;
                this.setPathToEntity((PathEntity)null);
                this.setTarget((Entity)null);
                this.setAttackTarget((EntityLivingBase)null);
            }
        }
        else if (itemstack != null && itemstack.getItem() == ModItems.nileBone && !this.isAngry())
        {
            if (!par1EntityPlayer.capabilities.isCreativeMode)
            {
                --itemstack.stackSize;
            }

            if (itemstack.stackSize <= 0)
            {
                par1EntityPlayer.inventory.setInventorySlotContents(par1EntityPlayer.inventory.currentItem, (ItemStack)null);
            }

            if (isServer())
            {
                tamedFor(par1EntityPlayer, rand.nextInt(3) == 0);
            	par1EntityPlayer.triggerAchievement(ModAchievements.ZertTame);
            }

            return true;
        }

        return super.interact(par1EntityPlayer);
    }
    
    public boolean canInteract(EntityPlayer player) {
        if(player.getCommandSenderName().equalsIgnoreCase(this.func_152113_b())) {
        }
        return true;
       }

    @SideOnly(Side.CLIENT)
    public void handleHealthUpdate(byte p_70103_1_)
    {
        if (p_70103_1_ == 
        {
            this.field_70928_h = true;
            this.timeWolfIsShaking = 0.0F;
            this.prevTimeWolfIsShaking = 0.0F;
        }
        else
        {
            super.handleHealthUpdate(p_70103_1_);
        }
    }

    @SideOnly(Side.CLIENT)
    public float getTailRotation()
    {
        return this.isAngry() ? 1.5393804F : (this.isTamed() ? (0.55F - (20.0F - this.dataWatcher.getWatchableObjectFloat(18)) * 0.02F) * (float)Math.PI : ((float)Math.PI / 5F));
    }

    /**
     * Checks if the parameter is an item which this animal can be fed to breed it (wheat, carrots or seeds depending on
     * the animal type)
     */
    public boolean isBreedingItem(ItemStack itemstack)
    {
    	return itemstack == null ? false : itemstack.getItem() == ModItems.dogTreat;
    }

    /**
     * Will return how many at most can spawn in a chunk at once.
     */
    public int getMaxSpawnedInChunk()
    {
        return 8;
    }

    /**
     * Determines whether this wolf is angry or not.
     */
    public boolean isAngry()
    {
        return (this.dataWatcher.getWatchableObjectByte(16) & 2) != 0;
    }

    /**
     * Sets whether this wolf is angry or not.
     */
    public void setAngry(boolean p_70916_1_)
    {
        byte b0 = this.dataWatcher.getWatchableObjectByte(16);

        if (p_70916_1_)
        {
            this.dataWatcher.updateObject(16, Byte.valueOf((byte)(b0 | 2)));
        }
        else
        {
            this.dataWatcher.updateObject(16, Byte.valueOf((byte)(b0 & -3)));
        }
    }

    /**
     * Return this wolf's collar color.
     */
    public int getCollarColor()
    {
        return this.dataWatcher.getWatchableObjectByte(20) & 15;
    }

    /**
     * Set this wolf's collar color.
     */
    public void setCollarColor(int p_82185_1_)
    {
        this.dataWatcher.updateObject(20, Byte.valueOf((byte)(p_82185_1_ & 15)));
    }

    public EntityIceZertum createChild(EntityAgeable p_90011_1_)
    {
    	EntityIceZertum entitywolf = new EntityIceZertum(this.worldObj);
        String s = this.func_152113_b();

        if (s != null && s.trim().length() > 0)
        {
            entitywolf.func_152115_b(s);
            entitywolf.setTamed(true);
        }

        return entitywolf;
    }

    public void func_70918_i(boolean p_70918_1_)
    {
        if (p_70918_1_)
        {
            this.dataWatcher.updateObject(19, Byte.valueOf((byte)1));
        }
        else
        {
            this.dataWatcher.updateObject(19, Byte.valueOf((byte)0));
        }
    }

    /**
     * Returns true if the mob is currently able to mate with the specified mob.
     */
    public boolean canMateWith(EntityAnimal p_70878_1_)
    {
        if (p_70878_1_ == this)
        {
            return false;
        }
        else if (!this.isTamed())
        {
            return false;
        }
        else if (!(p_70878_1_ instanceof EntityIceZertum))
        {
            return false;
        }
        else
        {
            EntityIceZertum entitywolf = (EntityIceZertum)p_70878_1_;
            return !entitywolf.isTamed() ? false : (entitywolf.isSitting() ? false : this.isInLove() && entitywolf.isInLove());
        }
    }

    public boolean func_70922_bv()
    {
        return this.dataWatcher.getWatchableObjectByte(19) == 1;
    }

    /**
     * Determines if an entity can be despawned, used on idle far away entities
     */
    protected boolean canDespawn()
    {
        return !this.isTamed() && this.ticksExisted > 2400;
    }

    public boolean func_142018_a(EntityLivingBase p_142018_1_, EntityLivingBase p_142018_2_)
    {
        if (!(p_142018_1_ instanceof EntityCreeper) && !(p_142018_1_ instanceof EntityGhast))
        {
            if (p_142018_1_ instanceof EntityIceZertum)
            {
                EntityIceZertum entitywolf = (EntityIceZertum)p_142018_1_;

                if (entitywolf.isTamed() && entitywolf.getOwner() == p_142018_2_)
                {
                    return false;
                }
            }

            return p_142018_1_ instanceof EntityPlayer && p_142018_2_ instanceof EntityPlayer && !((EntityPlayer)p_142018_2_).canAttackPlayer((EntityPlayer)p_142018_1_) ? false : !(p_142018_1_ instanceof EntityHorse) || !((EntityHorse)p_142018_1_).isTame();
        }
        else
        {
            return false;
        }
    }
}

Main Developer and Owner of Zero Quest

Visit the Wiki for more information

If I helped anyone, please give me a applaud and a thank you!

Link to comment
Share on other sites

Well, you've given them both the same priority.  I'm not sure but I assume the mutex bits in both AI classes (leap and arrow) prevent them from both running at the same time.  So if the entity is far away from player it will choose to do arrow before it chooses leap because it only leaps when it is closer.  Once it starts shooting, it will prevent the leaping.

 

If you want it to change the priority of leap versus arrow based on how close it is to the player, I think you'll have to make some custom AI class.  I'd probably combine them both into one AI -- and in that code you can have a field that keeps track of whether you want to leap or do arrow and such. 

 

To put it another way, the AI task lists give some control but not full control over how two AI tasks will work together.  If you want to specifically control which AI task should be done I think combining them into one and using your own logic to decide is way to go.

Check out my tutorials here: http://jabelarminecraft.blogspot.com/

Link to comment
Share on other sites

Well, you've given them both the same priority.  I'm not sure but I assume the mutex bits in both AI classes (leap and arrow) prevent them from both running at the same time.  So if the entity is far away from player it will choose to do arrow before it chooses leap because it only leaps when it is closer.  Once it starts shooting, it will prevent the leaping.

 

If you want it to change the priority of leap versus arrow based on how close it is to the player, I think you'll have to make some custom AI class.  I'd probably combine them both into one AI -- and in that code you can have a field that keeps track of whether you want to leap or do arrow and such. 

 

To put it another way, the AI task lists give some control but not full control over how two AI tasks will work together.  If you want to specifically control which AI task should be done I think combining them into one and using your own logic to decide is way to go.

 

Would changing the mutex numbers to 0 would force them to run together? I looked at the source code and read some info about mutex.

Main Developer and Owner of Zero Quest

Visit the Wiki for more information

If I helped anyone, please give me a applaud and a thank you!

Link to comment
Share on other sites

Ok! I figured out when I changed the mutex of both the arrow attack task and the leaping task to 0, they both ran at the same time but now the wolf is continuously running.. any way to stop that?

 

 

EDIT:

 

Ok, now I noticed that the task only worked when the entity was close to something. Now what?

Main Developer and Owner of Zero Quest

Visit the Wiki for more information

If I helped anyone, please give me a applaud and a thank you!

Link to comment
Share on other sites

Still can't get it to work  :( Am I setting something wrong?

 

AIAttackArrow code

import net.minecraft.entity.EntityLiving;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.IRangedAttackMob;
import net.minecraft.entity.ai.EntityAIBase;
import net.minecraft.util.MathHelper;

public class EntityAICustomArrowAttack extends EntityAIBase
{
    /** The entity the AI instance has been applied to */
    private final EntityLiving entityHost;
    /**
     * The entity (as a RangedAttackMob) the AI instance has been applied to.
     */
    private final IRangedAttackMob rangedAttackEntityHost;
    private EntityLivingBase attackTarget;
    /**
     * A decrementing tick that spawns a ranged attack once this value reaches 0. It is then set back to the
     * maxRangedAttackTime.
     */
    private int rangedAttackTime;
    private double entityMoveSpeed;
    private int field_75318_f;
    private int field_96561_g;
    /**
     * The maximum time the AI has to wait before peforming another ranged attack.
     */
    private int maxRangedAttackTime;
    private float field_96562_i;
    private float field_82642_h;
    private static final String __OBFID = "CL_00001609";

    public EntityAICustomArrowAttack(IRangedAttackMob p_i1649_1_, double p_i1649_2_, int p_i1649_4_, float p_i1649_5_)
    {
        this(p_i1649_1_, p_i1649_2_, p_i1649_4_, p_i1649_4_, p_i1649_5_);
    }

    public EntityAICustomArrowAttack(IRangedAttackMob p_i1650_1_, double p_i1650_2_, int p_i1650_4_, int p_i1650_5_, float p_i1650_6_)
    {
        this.rangedAttackTime = -1;

        if (!(p_i1650_1_ instanceof EntityLivingBase))
        {
            throw new IllegalArgumentException("ArrowAttackGoal requires Mob implements RangedAttackMob");
        }
        else
        {
            this.rangedAttackEntityHost = p_i1650_1_;
            this.entityHost = (EntityLiving)p_i1650_1_;
            this.entityMoveSpeed = p_i1650_2_;
            this.field_96561_g = p_i1650_4_;
            this.maxRangedAttackTime = p_i1650_5_;
            this.field_96562_i = p_i1650_6_;
            this.field_82642_h = p_i1650_6_ * p_i1650_6_;
            this.setMutexBits(;
        }
    }

    /**
     * Returns whether the EntityAIBase should begin execution.
     */
    public boolean shouldExecute()
    {
        EntityLivingBase entitylivingbase = this.entityHost.getAttackTarget();

        if (entitylivingbase == null)
        {
            return false;
        }
        else
        {
            this.attackTarget = entitylivingbase;
            return true;
        }
    }

    /**
     * Returns whether an in-progress EntityAIBase should continue executing
     */
    public boolean continueExecuting()
    {
        return this.shouldExecute() || !this.entityHost.getNavigator().noPath();
    }

    /**
     * Resets the task
     */
    public void resetTask()
    {
        this.attackTarget = null;
        this.field_75318_f = 0;
        this.rangedAttackTime = -1;
    }

    /**
     * Updates the task
     */
    public void updateTask()
    {
        double d0 = this.entityHost.getDistanceSq(this.attackTarget.posX, this.attackTarget.boundingBox.minY, this.attackTarget.posZ);
        boolean flag = this.entityHost.getEntitySenses().canSee(this.attackTarget);

        if (flag)
        {
            ++this.field_75318_f;
        }
        else
        {
            this.field_75318_f = 0;
        }

        if (d0 <= (double)this.field_82642_h && this.field_75318_f >= 20)
        {
            this.entityHost.getNavigator().clearPathEntity();
        }
        else
        {
            this.entityHost.getNavigator().tryMoveToEntityLiving(this.attackTarget, this.entityMoveSpeed);
        }

        this.entityHost.getLookHelper().setLookPositionWithEntity(this.attackTarget, 30.0F, 30.0F);
        float f;

        if (--this.rangedAttackTime == 0)
        {
            if (d0 > (double)this.field_82642_h || !flag)
            {
                return;
            }

            f = MathHelper.sqrt_double(d0) / this.field_96562_i;
            float f1 = f;

            if (f < 0.1F)
            {
                f1 = 0.1F;
            }

            if (f1 > 1.0F)
            {
                f1 = 1.0F;
            }

            this.rangedAttackEntityHost.attackEntityWithRangedAttack(this.attackTarget, f1);
            this.rangedAttackTime = MathHelper.floor_float(f * (float)(this.maxRangedAttackTime - this.field_96561_g) + (float)this.field_96561_g);
        }
        else if (this.rangedAttackTime < 0)
        {
            f = MathHelper.sqrt_double(d0) / this.field_96562_i;
            this.rangedAttackTime = MathHelper.floor_float(f * (float)(this.maxRangedAttackTime - this.field_96561_g) + (float)this.field_96561_g);
        }
    }
}

 

Leaping AI Code

import net.minecraft.entity.EntityLiving;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.ai.EntityAIBase;
import net.minecraft.util.MathHelper;

public class EntityAICustomLeapAtTarget extends EntityAIBase
{
    /** The entity that is leaping. */
    EntityLiving leaper;
    /** The entity that the leaper is leaping towards. */
    EntityLivingBase leapTarget;
    /** The entity's motionY after leaping. */
    float leapMotionY;
    private static final String __OBFID = "CL_00001591";

    public EntityAICustomLeapAtTarget(EntityLiving p_i1630_1_, float p_i1630_2_)
    {
        this.leaper = p_i1630_1_;
        this.leapMotionY = p_i1630_2_;
        this.setMutexBits(;
    }

    /**
     * Returns whether the EntityAIBase should begin execution.
     */
    public boolean shouldExecute()
    {
        this.leapTarget = this.leaper.getAttackTarget();

        if (this.leapTarget == null)
        {
            return false;
        }
        else
        {
            double d0 = this.leaper.getDistanceSqToEntity(this.leapTarget);
            return d0 >= 4.0D && d0 <= 16.0D ? (!this.leaper.onGround ? false : this.leaper.getRNG().nextInt(5) == 0) : false;
        }
    }

    /**
     * Returns whether an in-progress EntityAIBase should continue executing
     */
    public boolean continueExecuting()
    {
        return !this.leaper.onGround;
    }

    /**
     * Execute a one shot task or start executing a continuous task
     */
    public void startExecuting()
    {
        double d0 = this.leapTarget.posX - this.leaper.posX;
        double d1 = this.leapTarget.posZ - this.leaper.posZ;
        float f = MathHelper.sqrt_double(d0 * d0 + d1 * d1);
        this.leaper.motionX += d0 / (double)f * 0.5D * 0.800000011920929D + this.leaper.motionX * 0.20000000298023224D;
        this.leaper.motionZ += d1 / (double)f * 0.5D * 0.800000011920929D + this.leaper.motionZ * 0.20000000298023224D;
        this.leaper.motionY = (double)this.leapMotionY;
    }
}

 

Zertum Code

import java.util.List;

import net.minecraft.block.Block;
import net.minecraft.block.BlockColored;
import net.minecraft.block.material.Material;
import net.minecraft.enchantment.EnchantmentHelper;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityAgeable;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.IRangedAttackMob;
import net.minecraft.entity.SharedMonsterAttributes;
import net.minecraft.entity.ai.EntityAIArrowAttack;
import net.minecraft.entity.ai.EntityAIAttackOnCollide;
import net.minecraft.entity.ai.EntityAIHurtByTarget;
import net.minecraft.entity.ai.EntityAILeapAtTarget;
import net.minecraft.entity.ai.EntityAILookIdle;
import net.minecraft.entity.ai.EntityAIMate;
import net.minecraft.entity.ai.EntityAISwimming;
import net.minecraft.entity.ai.EntityAIWander;
import net.minecraft.entity.ai.EntityAIWatchClosest;
import net.minecraft.entity.monster.EntityCreeper;
import net.minecraft.entity.monster.EntityGhast;
import net.minecraft.entity.passive.EntityAnimal;
import net.minecraft.entity.passive.EntityHorse;
import net.minecraft.entity.passive.EntitySheep;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.projectile.EntityArrow;
import net.minecraft.entity.projectile.EntitySnowball;
import net.minecraft.init.Blocks;
import net.minecraft.init.Items;
import net.minecraft.item.ItemFood;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.pathfinding.PathEntity;
import net.minecraft.potion.PotionEffect;
import net.minecraft.util.AxisAlignedBB;
import net.minecraft.util.DamageSource;
import net.minecraft.util.MathHelper;
import net.minecraft.world.World;
import common.zeroquest.ModAchievements;
import common.zeroquest.ModItems;
import common.zeroquest.entity.ai.EntityCustomIZAIBeg;
import common.zeroquest.entity.ai.tameable.EntityCustomAIFollowOwner;
import common.zeroquest.entity.ai.tameable.EntityCustomAIOwnerHurtByTarget;
import common.zeroquest.entity.ai.tameable.EntityCustomAIOwnerHurtTarget;
import common.zeroquest.entity.ai.tameable.EntityCustomAITargetNonTamed;
import common.zeroquest.entity.ai.targeting.EntityAICustomArrowAttack;
import common.zeroquest.entity.ai.targeting.EntityAICustomLeapAtTarget;
import common.zeroquest.entity.projectile.EntityIceball;
import common.zeroquest.lib.Constants;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;

public class EntityIceZertum extends EntityCustomTameable implements IRangedAttackMob
{   
    /**
     * This time increases while wolf is shaking and emitting water particles.
     */
    
    private float field_70926_e;
    private float field_70924_f;
    /** true is the wolf is wet else false */
    private boolean isShaking;
    private boolean field_70928_h;
    /**
     * This time increases while wolf is shaking and emitting water particles.
     */
    private float timeWolfIsShaking;
    private float prevTimeWolfIsShaking;
    private static final String __OBFID = "CL_00001654";
    public int rare;
    //public InventoryPack inventory;
    private boolean canSeeCreeper;
    
    public static final double maxHealth = 35;
    public static final double attackDamage = 6;
    public static final double speed = 0.30000001192092896;
    public static final double maxHealthTamed = 40;
    public static final double attackDamageTamed = 8;
    public static final double maxHealthBaby = 10;
    public static final double attackDamageBaby = 4;
private int timer;

    public EntityIceZertum(World p_i1696_1_)
    {
        super(p_i1696_1_);
        this.setSize(0.6F, 0.8F);
        this.getNavigator().setAvoidsWater(true);
        this.tasks.addTask(1, new EntityAISwimming(this));
        this.tasks.addTask(2, this.aiCSit);
        this.tasks.addTask(3, new EntityAICustomLeapAtTarget(this, 0.4F));
	this.tasks.addTask(3, new EntityAICustomArrowAttack(this, 0.1, 60, 10.0F));
        this.tasks.addTask(4, new EntityAIAttackOnCollide(this, 1.0D, true));
        this.tasks.addTask(5, new EntityCustomAIFollowOwner(this, 1.0D, 10.0F, 2.0F));
        this.tasks.addTask(6, new EntityAIMate(this, 1.0D));
        this.tasks.addTask(7, new EntityAIWander(this, 1.0D));
        this.tasks.addTask(8, new EntityCustomIZAIBeg(this, 8.0F));
        this.tasks.addTask(9, new EntityAIWatchClosest(this, EntityPlayer.class, 8.0F));
        this.tasks.addTask(9, new EntityAILookIdle(this));
        this.targetTasks.addTask(1, new EntityCustomAIOwnerHurtByTarget(this));
        this.targetTasks.addTask(2, new EntityCustomAIOwnerHurtTarget(this));
        this.targetTasks.addTask(3, new EntityAIHurtByTarget(this, true));
        this.targetTasks.addTask(4, new EntityCustomAITargetNonTamed(this, EntitySheep.class, 200, false));
        this.setTamed(false);
        //this.inventory = new InventoryPack(this);
    }

    protected void applyEntityAttributes()
    {
        super.applyEntityAttributes();
        this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(maxHealth);
        this.getEntityAttribute(SharedMonsterAttributes.attackDamage).setBaseValue(attackDamage);
        this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(speed);

        if (this.isTamed())
        {
            this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(maxHealthTamed);
            this.getEntityAttribute(SharedMonsterAttributes.attackDamage).setBaseValue(attackDamageTamed);
        }
        else if (this.isChild())
        {
            this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(maxHealthBaby);
            this.getEntityAttribute(SharedMonsterAttributes.attackDamage).setBaseValue(attackDamageBaby);
        }
    }

    /**
     * Returns true if the newer Entity AI code should be run
     */
    public boolean isAIEnabled()
    {
        return true;
    }

    /**
     * Sets the active target the Task system uses for tracking
     */
    public void setAttackTarget(EntityLivingBase p_70624_1_)
    {
        super.setAttackTarget(p_70624_1_);

        if (p_70624_1_ == null)
        {
            this.setAngry(false);
        }
        else if (!this.isTamed())
        {
            this.setAngry(true);
        }
    }

    /**
     * main AI tick function, replaces updateEntityActionState
     */
    protected void updateAITick()
    {
        this.dataWatcher.updateObject(18, Float.valueOf(this.getHealth()));
    }

    protected void entityInit()
    {
        super.entityInit();
        this.dataWatcher.addObject(18, new Float(this.getHealth()));
        this.dataWatcher.addObject(19, new Byte((byte)0));
        this.dataWatcher.addObject(20, new Byte((byte)BlockColored.func_150032_b(1)));
    }

    protected void func_145780_a(int p_145780_1_, int p_145780_2_, int p_145780_3_, Block p_145780_4_)
    {
        this.playSound("mob.wolf.step", 0.15F, 1.0F);
    }

    /**
     * (abstract) Protected helper method to write subclass entity data to NBT.
     */
    public void writeEntityToNBT(NBTTagCompound p_70014_1_)
    {
        super.writeEntityToNBT(p_70014_1_);
        p_70014_1_.setBoolean("Angry", this.isAngry());
        p_70014_1_.setByte("CollarColor", (byte)this.getCollarColor());
    }

    /**
     * (abstract) Protected helper method to read subclass entity data from NBT.
     */
    public void readEntityFromNBT(NBTTagCompound p_70037_1_)
    {
        super.readEntityFromNBT(p_70037_1_);
        this.setAngry(p_70037_1_.getBoolean("Angry"));

        if (p_70037_1_.hasKey("CollarColor", 99))
        {
            this.setCollarColor(p_70037_1_.getByte("CollarColor"));
        }
    }

    /**
     * Returns the sound this mob makes while it's alive.
     */
    protected String getLivingSound()
    {
        return this.canSeeCreeper ? "mob.wolf.growl" : this.isAngry() ? "mob.wolf.growl" : 
        	(this.rand.nextInt(3) == 0 ? 
        			(this.isTamed() && this.getHealth() < 10.0F ? "mob.wolf.whine"
        					: "mob.wolf.panting")
        					: "mob.wolf.bark");
    }

    /**
     * Returns the sound this mob makes when it is hurt.
     */
    protected String getHurtSound()
    {
        return "mob.wolf.hurt";
    }

    /**
     * Returns the sound this mob makes on death.
     */
    protected String getDeathSound()
    {
        return "mob.wolf.death";
    }

    /**
     * Returns the volume for the sounds this mob makes.
     */
    protected float getSoundVolume()
    {
        return 0.5F;
    }

    /**
     * Get number of ticks, at least during which the living entity will be silent.
     */
@Override
    public int getTalkInterval() {
    	if(this.canSeeCreeper){
    		return 40;
    	}else if(this.getHealth() <=10){
    		return 20;
    	}else{
    		return 200;
    	}
    }
    
    /**
     * Returns the item ID for the item the mob drops on death.
     */
    protected void dropFewItems(boolean par1, int par2)
    {
        rare = rand.nextInt(20);
            {
                if (this.isBurning())
                {
                    this.dropItem(ModItems.zertumMeatCooked, 1);
                }
                else if (rare <= 12)
                {
                    this.dropItem(ModItems.zertumMeatRaw, 1);
                }
                if(rare <= 6 && !this.isTamed())
                {
                	this.dropItem(ModItems.nileGrain, 1);
                }
                /*if(rare >= 17)
                {
                	this.dropItem(ModItems.nileDust.itemID, 1);
                }*/
                else
                {
                	
                }
                
            }
        }

    /**
     * Called frequently so the entity can update its state every tick as required. For example, zombies and skeletons
     * use this to react to sunlight and start to burn.
     */
    public void onLivingUpdate()
    {
	if (isServer() && this.timer > 0) { //TODO cooldown
		timer--;
	}
    	
        super.onLivingUpdate();       
      	double d0 = this.rand.nextGaussian() * 0.04D;
    	double d1 = this.rand.nextGaussian() * 0.04D;
    	double d2 = this.rand.nextGaussian() * 0.04D;
    	worldObj.spawnParticle("snowshovel", this.posX + (double)(this.rand.nextFloat() * this.width * 2.0F) - (double)this.width, this.posY + 0.5D + (double)(this.rand.nextFloat() * this.height), this.posZ + (double)(this.rand.nextFloat() * this.width * 2.0F) - (double)this.width, d0, d1, d2);
    	
    	for (int l = 0; l < 4; ++l)
        {
            int i = MathHelper.floor_double(this.posX + (double)((float)(l % 2 * 2 - 1) * 0.25F));
            int j = MathHelper.floor_double(this.posY);
            int k = MathHelper.floor_double(this.posZ + (double)((float)(l / 2 % 2 * 2 - 1) * 0.25F));

            if (this.worldObj.getBlock(i, j, k).getMaterial() == Material.air && Blocks.snow_layer.canPlaceBlockAt(this.worldObj, i, j, k))
            {
                this.worldObj.setBlock(i, j, k, Blocks.snow_layer);
            }
            if (this.worldObj.getBlock(i, j, k).getMaterial() == Material.water && Blocks.ice.canPlaceBlockAt(this.worldObj, i, j, k))
            {
                this.worldObj.setBlock(i, j, k, Blocks.ice);
            }
        }

        if (!this.worldObj.isRemote && this.isShaking && !this.field_70928_h && !this.hasPath() && this.onGround)
        {
            this.field_70928_h = true;
            this.timeWolfIsShaking = 0.0F;
            this.prevTimeWolfIsShaking = 0.0F;
            this.worldObj.setEntityState(this, (byte);
        }
        
        if(this.entityToAttack != null && this.entityToAttack.isDead) {
            this.entityToAttack = null;
        }
        
        if(Constants.DEF_HEALING == true && !this.isChild() && this.getHealth() <=10 && this.isTamed())
        {
       		this.addPotionEffect(new PotionEffect(10, 200));
        }
        
        if (this.getAttackTarget() == null && isTamed() && 15 > 0) {
            List list1 = worldObj.getEntitiesWithinAABB(EntityCreeper.class, AxisAlignedBB.getBoundingBox(posX, posY, posZ, posX + 1.0D, posY + 1.0D, posZ + 1.0D).expand(sniffRange(), 4D, sniffRange()));

            if (!list1.isEmpty() && !isSitting() && this.getHealth() > 1 && !this.isChild()) { //TODO
                canSeeCreeper = true;
              	double d3 = 0.5D + this.rand.nextGaussian() * 0.04D;
            	double d4 = 0.0D + this.rand.nextGaussian() * 0.04D;
            	double d5 = 0.0D + this.rand.nextGaussian() * 0.04D;
            	worldObj.spawnParticle("reddust", this.posX + (double)(this.rand.nextFloat() * this.width * 2.0F) - (double)this.width, this.posY + 0.5D + (double)(this.rand.nextFloat() * this.height), this.posZ + (double)(this.rand.nextFloat() * this.width * 2.0F) - (double)this.width, d3, d4, d5);
            }
            else {
                canSeeCreeper = false;
            }
        }
    }
    

    public double sniffRange(){
        double d = 0.0D;
        for (int i = 0; i < 15 * 6; i++)
        {
            d++;
        }
        return d;
    }

    /**
     * Called to update the entity's position/logic.
     */
    public void onUpdate()
    {
        super.onUpdate(); 
        this.field_70924_f = this.field_70926_e;

        if (this.func_70922_bv())
        {
            this.field_70926_e += (1.0F - this.field_70926_e) * 0.4F;
        }
        else
        {
            this.field_70926_e += (0.0F - this.field_70926_e) * 0.4F;
        }

        if (this.func_70922_bv())
        {
            this.numTicksToChaseTarget = 10;
        }

        if (this.isWet())
        {
            this.isShaking = true;
            this.field_70928_h = false;
            this.timeWolfIsShaking = 0.0F;
            this.prevTimeWolfIsShaking = 0.0F;
        }
        else if ((this.isShaking || this.field_70928_h) && this.field_70928_h)
        {
            if (this.timeWolfIsShaking == 0.0F)
            {
                this.playSound("mob.wolf.shake", this.getSoundVolume(), (this.rand.nextFloat() - this.rand.nextFloat()) * 0.2F + 1.0F);
            }

            this.prevTimeWolfIsShaking = this.timeWolfIsShaking;
            this.timeWolfIsShaking += 0.05F;

            if (this.prevTimeWolfIsShaking >= 2.0F)
            {
                this.isShaking = false;
                this.field_70928_h = false;
                this.prevTimeWolfIsShaking = 0.0F;
                this.timeWolfIsShaking = 0.0F;
            }

            if (this.timeWolfIsShaking > 0.4F)
            {
                float f = (float)this.boundingBox.minY;
                int i = (int)(MathHelper.sin((this.timeWolfIsShaking - 0.4F) * (float)Math.PI) * 7.0F);

                for (int j = 0; j < i; ++j)
                {
                    float f1 = (this.rand.nextFloat() * 2.0F - 1.0F) * this.width * 0.5F;
                    float f2 = (this.rand.nextFloat() * 2.0F - 1.0F) * this.width * 0.5F;
                    this.worldObj.spawnParticle("splash", this.posX + (double)f1, (double)(f + 0.8F), this.posZ + (double)f2, this.motionX, this.motionY, this.motionZ);
                }
            }
        }
    }

    @SideOnly(Side.CLIENT)
    public boolean getWolfShaking()
    {
        return this.isShaking;
    }

    /**
     * Used when calculating the amount of shading to apply while the wolf is shaking.
     */
    @SideOnly(Side.CLIENT)
    public float getShadingWhileShaking(float p_70915_1_)
    {
        return 0.75F + (this.prevTimeWolfIsShaking + (this.timeWolfIsShaking - this.prevTimeWolfIsShaking) * p_70915_1_) / 2.0F * 0.25F;
    }

    @SideOnly(Side.CLIENT)
    public float getShakeAngle(float p_70923_1_, float p_70923_2_)
    {
        float f2 = (this.prevTimeWolfIsShaking + (this.timeWolfIsShaking - this.prevTimeWolfIsShaking) * p_70923_1_ + p_70923_2_) / 1.8F;

        if (f2 < 0.0F)
        {
            f2 = 0.0F;
        }
        else if (f2 > 1.0F)
        {
            f2 = 1.0F;
        }

        return MathHelper.sin(f2 * (float)Math.PI) * MathHelper.sin(f2 * (float)Math.PI * 11.0F) * 0.15F * (float)Math.PI;
    }

    public float getEyeHeight()
    {
        return this.height * 0.8F;
    }

    @SideOnly(Side.CLIENT)
    public float getInterestedAngle(float p_70917_1_)
    {
        return (this.field_70924_f + (this.field_70926_e - this.field_70924_f) * p_70917_1_) * 0.15F * (float)Math.PI;
    }

    /**
     * The speed it takes to move the entityliving's rotationPitch through the faceEntity method. This is only currently
     * use in wolves.
     */
    public int getVerticalFaceSpeed()
    {
        return this.isSitting() ? 20 : super.getVerticalFaceSpeed();
    }

    /**
     * Called when the entity is attacked.
     */
    public boolean attackEntityFrom(DamageSource p_70097_1_, float p_70097_2_)
    {
        if (this.isEntityInvulnerable())
        {
            return false;
        }
        else
        {
            Entity entity = p_70097_1_.getEntity();
            this.aiCSit.setSitting(false);

            if (entity != null && !(entity instanceof EntityPlayer) && !(entity instanceof EntityArrow))
            {
                p_70097_2_ = (p_70097_2_ + 1.0F) / 2.0F;
            }

            return super.attackEntityFrom(p_70097_1_, p_70097_2_);
        }
    }

    public boolean attackEntityAsMob(Entity par1Entity)
    {
        float f = (float)this.getEntityAttribute(SharedMonsterAttributes.attackDamage).getAttributeValue();
        int i = 0;

        if (par1Entity instanceof EntityLivingBase)
        {
            f += EnchantmentHelper.getEnchantmentModifierLiving(this, (EntityLivingBase)par1Entity);
            i += EnchantmentHelper.getKnockbackModifier(this, (EntityLivingBase)par1Entity);
            
        }

        boolean flag = par1Entity.attackEntityFrom(DamageSource.causeMobDamage(this), f);

        if (flag)
        {
            if (i > 0)
            {
                par1Entity.addVelocity((double)(-MathHelper.sin(this.rotationYaw * (float)Math.PI / 180.0F) * (float)i * 0.5F), 0.1D, (double)(MathHelper.cos(this.rotationYaw * (float)Math.PI / 180.0F) * (float)i * 0.5F));
                this.motionX *= 0.6D;
                this.motionZ *= 0.6D;
            }
        }
	return flag;
    }
    
@Override
public void attackEntityWithRangedAttack(EntityLivingBase p_82196_1_, float p_82196_2_) { //TODO ranged attack
	if (timer == 0) {
        EntityIceball entityIceball = new EntityIceball(this.worldObj, this);
        double d0 = p_82196_1_.posX - this.posX;
        double d1 = p_82196_1_.posY + (double)p_82196_1_.getEyeHeight() - 1.100000023841858D - entityIceball.posY;
        double d2 = p_82196_1_.posZ - this.posZ;
        float f1 = MathHelper.sqrt_double(d0 * d0 + d2 * d2) * 0.2F;
        entityIceball.setThrowableHeading(d0, d1 + (double)f1, d2, 1.6F, 12.0F);
        this.worldObj.playAuxSFXAtEntity((EntityPlayer)null, 1014, (int)this.posX, (int)this.posY, (int)this.posZ, 0);
        this.worldObj.spawnEntityInWorld(entityIceball);
		timer = 100;

	} else {
         this.tasks.addTask(3, new EntityAICustomLeapAtTarget(this, 0.4F));
		 this.attackEntity(p_82196_1_, p_82196_2_);
		 this.attackEntityAsMob(p_82196_1_);
	}
}
    
    /**
     * Called when the mob's health reaches 0.
     */
    public void onDeath(DamageSource par1DamageSource)
    {
        super.onDeath(par1DamageSource);

        if (par1DamageSource.getEntity() instanceof EntityPlayer)
        {
            EntityPlayer entityplayer = (EntityPlayer)par1DamageSource.getEntity();
            {
                //entityplayer.triggerAchievement(ModAchievements.ZertKill); TODO achievement
                //this.dropChestItems(); TODO Inventory
                
            }
        }
    }
    
    /*public void dropChestItems() TODO Inventory
    {
        this.dropItemsInChest(this, this.inventory);
    }
    
    private void dropItemsInChest(Entity par1Entity, InventoryPack inventory2)
    {
        if (inventory2 != null && !this.worldObj.isRemote)
        {
            for (int i = 0; i < inventory2.getSizeInventory(); ++i)
            {
                ItemStack itemstack = inventory2.getStackInSlot(i);

                if (itemstack != null)
                {
                    this.entityDropItem(itemstack, 0.0F);
                }
            }
        }
    }*/

    /**
     * Called when a player interacts with a mob. e.g. gets milk from a cow, gets into the saddle on a pig.
     */
    public boolean interact(EntityPlayer par1EntityPlayer)
    {
        ItemStack itemstack = par1EntityPlayer.inventory.getCurrentItem();

        if (this.isTamed())
        {
            if (itemstack != null)
            {
                if (itemstack.getItem() instanceof ItemFood)
                {
                    ItemFood itemfood = (ItemFood)itemstack.getItem();

                    if (itemfood.isWolfsFavoriteMeat() && this.dataWatcher.getWatchableObjectFloat(18) < 20.0F)
                    {
                        if (!par1EntityPlayer.capabilities.isCreativeMode)
                        {
                            --itemstack.stackSize;
                        }

                        this.heal((float)itemfood.func_150905_g(itemstack));

                        if (itemstack.stackSize <= 0)
                        {
                            par1EntityPlayer.inventory.setInventorySlotContents(par1EntityPlayer.inventory.currentItem, (ItemStack)null);
                        }

                        return true;
                    }
                }
                /*else if(itemstack.getItem() == Items.stick && canInteract(par1EntityPlayer)) TODO Inventory
                {
                 par1EntityPlayer.openGui(ZeroQuest.instance, CommonProxy.IceZertumPack, this.worldObj, this.getEntityId(), MathHelper.floor_double(this.posY), MathHelper.floor_double(this.posZ));
                 return true;
                }*/
                else if (itemstack.getItem() == Items.dye)
                {
                    int i = BlockColored.func_150032_b(itemstack.getItemDamage());

                    if (i != this.getCollarColor())
                    {
                        this.setCollarColor(i);

                        if (!par1EntityPlayer.capabilities.isCreativeMode && --itemstack.stackSize <= 0)
                        {
                            par1EntityPlayer.inventory.setInventorySlotContents(par1EntityPlayer.inventory.currentItem, (ItemStack)null);
                        }

                        return true;
                    }
                }
            }

            if (canInteract(par1EntityPlayer) && isServer() && !this.isBreedingItem(itemstack))
            {
                this.aiCSit.setSitting(!this.isSitting());
                this.isJumping = false;
                this.setPathToEntity((PathEntity)null);
                this.setTarget((Entity)null);
                this.setAttackTarget((EntityLivingBase)null);
            }
        }
        else if (itemstack != null && itemstack.getItem() == ModItems.nileBone && !this.isAngry())
        {
            if (!par1EntityPlayer.capabilities.isCreativeMode)
            {
                --itemstack.stackSize;
            }

            if (itemstack.stackSize <= 0)
            {
                par1EntityPlayer.inventory.setInventorySlotContents(par1EntityPlayer.inventory.currentItem, (ItemStack)null);
            }

            if (isServer())
            {
                tamedFor(par1EntityPlayer, rand.nextInt(3) == 0);
            	par1EntityPlayer.triggerAchievement(ModAchievements.ZertTame);
            }

            return true;
        }

        return super.interact(par1EntityPlayer);
    }
    
    public boolean canInteract(EntityPlayer player) {
        if(player.getCommandSenderName().equalsIgnoreCase(this.func_152113_b())) {
        }
        return true;
       }

    @SideOnly(Side.CLIENT)
    public void handleHealthUpdate(byte p_70103_1_)
    {
        if (p_70103_1_ == 
        {
            this.field_70928_h = true;
            this.timeWolfIsShaking = 0.0F;
            this.prevTimeWolfIsShaking = 0.0F;
        }
        else
        {
            super.handleHealthUpdate(p_70103_1_);
        }
    }

    @SideOnly(Side.CLIENT)
    public float getTailRotation()
    {
        return this.isAngry() ? 1.5393804F : (this.isTamed() ? (0.55F - (20.0F - this.dataWatcher.getWatchableObjectFloat(18)) * 0.02F) * (float)Math.PI : ((float)Math.PI / 5F));
    }

    /**
     * Checks if the parameter is an item which this animal can be fed to breed it (wheat, carrots or seeds depending on
     * the animal type)
     */
    public boolean isBreedingItem(ItemStack itemstack)
    {
    	return itemstack == null ? false : itemstack.getItem() == ModItems.dogTreat;
    }

    /**
     * Will return how many at most can spawn in a chunk at once.
     */
    public int getMaxSpawnedInChunk()
    {
        return 8;
    }

    /**
     * Determines whether this wolf is angry or not.
     */
    public boolean isAngry()
    {
        return (this.dataWatcher.getWatchableObjectByte(16) & 2) != 0;
    }

    /**
     * Sets whether this wolf is angry or not.
     */
    public void setAngry(boolean p_70916_1_)
    {
        byte b0 = this.dataWatcher.getWatchableObjectByte(16);

        if (p_70916_1_)
        {
            this.dataWatcher.updateObject(16, Byte.valueOf((byte)(b0 | 2)));
        }
        else
        {
            this.dataWatcher.updateObject(16, Byte.valueOf((byte)(b0 & -3)));
        }
    }

    /**
     * Return this wolf's collar color.
     */
    public int getCollarColor()
    {
        return this.dataWatcher.getWatchableObjectByte(20) & 15;
    }

    /**
     * Set this wolf's collar color.
     */
    public void setCollarColor(int p_82185_1_)
    {
        this.dataWatcher.updateObject(20, Byte.valueOf((byte)(p_82185_1_ & 15)));
    }

    public EntityIceZertum createChild(EntityAgeable p_90011_1_)
    {
    	EntityIceZertum entitywolf = new EntityIceZertum(this.worldObj);
        String s = this.func_152113_b();

        if (s != null && s.trim().length() > 0)
        {
            entitywolf.func_152115_b(s);
            entitywolf.setTamed(true);
        }

        return entitywolf;
    }

    public void func_70918_i(boolean p_70918_1_)
    {
        if (p_70918_1_)
        {
            this.dataWatcher.updateObject(19, Byte.valueOf((byte)1));
        }
        else
        {
            this.dataWatcher.updateObject(19, Byte.valueOf((byte)0));
        }
    }

    /**
     * Returns true if the mob is currently able to mate with the specified mob.
     */
    public boolean canMateWith(EntityAnimal p_70878_1_)
    {
        if (p_70878_1_ == this)
        {
            return false;
        }
        else if (!this.isTamed())
        {
            return false;
        }
        else if (!(p_70878_1_ instanceof EntityIceZertum))
        {
            return false;
        }
        else
        {
            EntityIceZertum entitywolf = (EntityIceZertum)p_70878_1_;
            return !entitywolf.isTamed() ? false : (entitywolf.isSitting() ? false : this.isInLove() && entitywolf.isInLove());
        }
    }

    public boolean func_70922_bv()
    {
        return this.dataWatcher.getWatchableObjectByte(19) == 1;
    }

    /**
     * Determines if an entity can be despawned, used on idle far away entities
     */
    protected boolean canDespawn()
    {
        return !this.isTamed() && this.ticksExisted > 2400;
    }

    public boolean func_142018_a(EntityLivingBase p_142018_1_, EntityLivingBase p_142018_2_)
    {
        if (!(p_142018_1_ instanceof EntityCreeper) && !(p_142018_1_ instanceof EntityGhast))
        {
            if (p_142018_1_ instanceof EntityIceZertum)
            {
                EntityIceZertum entitywolf = (EntityIceZertum)p_142018_1_;

                if (entitywolf.isTamed() && entitywolf.getOwner() == p_142018_2_)
                {
                    return false;
                }
            }

            return p_142018_1_ instanceof EntityPlayer && p_142018_2_ instanceof EntityPlayer && !((EntityPlayer)p_142018_2_).canAttackPlayer((EntityPlayer)p_142018_1_) ? false : !(p_142018_1_ instanceof EntityHorse) || !((EntityHorse)p_142018_1_).isTame();
        }
        else
        {
            return false;
        }
    }
}

Main Developer and Owner of Zero Quest

Visit the Wiki for more information

If I helped anyone, please give me a applaud and a thank you!

Link to comment
Share on other sites

The best thing to do is to trace the code execution to figure out what it is doing.  You can either make most of the AI custom and add System.out.println() console statements to give information about the exeuction, or you can run Eclipse in debug mode.

 

But basically you need to watch the functions and see if the shouldExecute() method is being called for each AI and if it is not being called then figure out why (i.e. usually another AI with lower priority already running) or if it is being called but returning false figure out why (print out the conditions for the shouldExecute() and figure out why they are false.

 

Basically, when code does something you don't expect and review of the source doesn't give any obvious ideas then next step is to trace the operation of the code while it is running to see why it is doing what it is doing.

Check out my tutorials here: http://jabelarminecraft.blogspot.com/

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



  • Recently Browsing

    • No registered users viewing this page.
  • Posts

    • I am making a mod for 1.20.6 I want to make a randomly generated structure using jigsaw but want to guarantee that a specific room is generated and not more than once. I cant generate starting from this room as I need to do this for 2 different rooms. I cant find more info on this in the Minecraft wiki or the forums. is it possible to set a min and max count for structure pieces?
    • the problem is I am using java 17, and the is no error log. the latest I have is from 02.04.2024. Its like the server just refuses to start. Here is a screenshot: https://ibb.co/S3kffy0
    • ---- Minecraft Crash Report ---- // There are four lights! Time: 22/05/24 03:33 Description: Initializing game java.lang.InternalError: Should not get here     at sun.nio.fs.WindowsNativeDispatcher.GetFinalPathNameByHandle(Native Method) ~[?:1.8.0_51] {}     at sun.nio.fs.WindowsLinkSupport.getFinalPath(WindowsLinkSupport.java:77) ~[?:1.8.0_51] {}     at sun.nio.fs.WindowsLinkSupport.getRealPath(WindowsLinkSupport.java:242) ~[?:1.8.0_51] {}     at sun.nio.fs.WindowsPath.toRealPath(WindowsPath.java:836) ~[?:1.8.0_51] {}     at sun.nio.fs.WindowsPath.toRealPath(WindowsPath.java:44) ~[?:1.8.0_51] {}     at net.minecraft.world.storage.SaveFormat.<init>(SaveFormat.java:75) ~[?:?] {re:mixin,re:classloading,pl:mixin:APP:modernfix-forge.mixins.json:perf.skip_first_datapack_reload.SaveFormatAccessor,pl:mixin:A}     at net.minecraft.client.Minecraft.<init>(Minecraft.java:445) [?:?] {re:mixin,pl:accesstransformer:B,pl:runtimedistcleaner:A,re:classloading,pl:accesstransformer:B,pl:mixin:APP:modernfix-common.mixins.json:feature.measure_time.MinecraftMixin,pl:mixin:APP:modernfix-common.mixins.json:perf.dedicated_reload_executor.MinecraftMixin,pl:mixin:APP:modernfix-common.mixins.json:bugfix.concurrency.MinecraftMixin,pl:mixin:APP:modernfix-common.mixins.json:bugfix.world_leaks.MinecraftMixin,pl:mixin:APP:modernfix-forge.mixins.json:feature.measure_time.MinecraftMixin_Forge,pl:mixin:APP:modernfix-forge.mixins.json:perf.skip_first_datapack_reload.MinecraftMixin,pl:mixin:APP:modernfix-forge.mixins.json:perf.blast_search_trees.MinecraftMixin,pl:mixin:APP:flywheel.mixins.json:ShaderCloseMixin,pl:mixin:APP:architectury.mixins.json:MixinMinecraft,pl:mixin:APP:assets/botania/botania.mixins.json:AccessorMinecraft,pl:mixin:APP:create.mixins.json:WindowResizeMixin,pl:mixin:APP:securitycraft.mixins.json:camera.MinecraftMixin,pl:mixin:A,pl:runtimedistcleaner:A}     at net.minecraft.client.main.Main.main(Main.java:149) [?:?] {re:classloading,pl:runtimedistcleaner:A}     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_51] {}     at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_51] {}     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_51] {}     at java.lang.reflect.Method.invoke(Method.java:497) ~[?:1.8.0_51] {}     at net.minecraftforge.fml.loading.FMLClientLaunchProvider.lambda$launchService$0(FMLClientLaunchProvider.java:37) [forge-1.16.5-36.2.42.jar:36.2] {}     at net.minecraftforge.fml.loading.FMLClientLaunchProvider$$Lambda$533/1770125555.call(Unknown Source) [forge-1.16.5-36.2.42.jar:36.2] {}     at cpw.mods.modlauncher.LaunchServiceHandlerDecorator.launch(LaunchServiceHandlerDecorator.java:37) [modlauncher-8.1.3.jar:?] {}     at cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:54) [modlauncher-8.1.3.jar:?] {}     at cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:72) [modlauncher-8.1.3.jar:?] {}     at cpw.mods.modlauncher.Launcher.run(Launcher.java:82) [modlauncher-8.1.3.jar:?] {re:classloading}     at cpw.mods.modlauncher.Launcher.main(Launcher.java:66) [modlauncher-8.1.3.jar:?] {re:classloading} A detailed walkthrough of the error, its code path and all known details is as follows: --------------------------------------------------------------------------------------- -- Head -- Thread: Render thread Stacktrace:     at sun.nio.fs.WindowsNativeDispatcher.GetFinalPathNameByHandle(Native Method) ~[?:1.8.0_51] {}     at sun.nio.fs.WindowsLinkSupport.getFinalPath(WindowsLinkSupport.java:77) ~[?:1.8.0_51] {}     at sun.nio.fs.WindowsLinkSupport.getRealPath(WindowsLinkSupport.java:242) ~[?:1.8.0_51] {}     at sun.nio.fs.WindowsPath.toRealPath(WindowsPath.java:836) ~[?:1.8.0_51] {}     at sun.nio.fs.WindowsPath.toRealPath(WindowsPath.java:44) ~[?:1.8.0_51] {}     at net.minecraft.world.storage.SaveFormat.<init>(SaveFormat.java:75) ~[?:?] {re:mixin,re:classloading,pl:mixin:APP:modernfix-forge.mixins.json:perf.skip_first_datapack_reload.SaveFormatAccessor,pl:mixin:A}     at net.minecraft.client.Minecraft.<init>(Minecraft.java:445) ~[?:?] {re:mixin,pl:accesstransformer:B,pl:runtimedistcleaner:A,re:classloading,pl:accesstransformer:B,pl:mixin:APP:modernfix-common.mixins.json:feature.measure_time.MinecraftMixin,pl:mixin:APP:modernfix-common.mixins.json:perf.dedicated_reload_executor.MinecraftMixin,pl:mixin:APP:modernfix-common.mixins.json:bugfix.concurrency.MinecraftMixin,pl:mixin:APP:modernfix-common.mixins.json:bugfix.world_leaks.MinecraftMixin,pl:mixin:APP:modernfix-forge.mixins.json:feature.measure_time.MinecraftMixin_Forge,pl:mixin:APP:modernfix-forge.mixins.json:perf.skip_first_datapack_reload.MinecraftMixin,pl:mixin:APP:modernfix-forge.mixins.json:perf.blast_search_trees.MinecraftMixin,pl:mixin:APP:flywheel.mixins.json:ShaderCloseMixin,pl:mixin:APP:architectury.mixins.json:MixinMinecraft,pl:mixin:APP:assets/botania/botania.mixins.json:AccessorMinecraft,pl:mixin:APP:create.mixins.json:WindowResizeMixin,pl:mixin:APP:securitycraft.mixins.json:camera.MinecraftMixin,pl:mixin:A,pl:runtimedistcleaner:A} -- Initialization -- Details: Stacktrace:     at net.minecraft.client.main.Main.main(Main.java:149) [?:?] {re:classloading,pl:runtimedistcleaner:A}     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_51] {}     at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_51] {}     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_51] {}     at java.lang.reflect.Method.invoke(Method.java:497) ~[?:1.8.0_51] {}     at net.minecraftforge.fml.loading.FMLClientLaunchProvider.lambda$launchService$0(FMLClientLaunchProvider.java:37) [forge-1.16.5-36.2.42.jar:36.2] {}     at net.minecraftforge.fml.loading.FMLClientLaunchProvider$$Lambda$533/1770125555.call(Unknown Source) [forge-1.16.5-36.2.42.jar:36.2] {}     at cpw.mods.modlauncher.LaunchServiceHandlerDecorator.launch(LaunchServiceHandlerDecorator.java:37) [modlauncher-8.1.3.jar:?] {}     at cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:54) [modlauncher-8.1.3.jar:?] {}     at cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:72) [modlauncher-8.1.3.jar:?] {}     at cpw.mods.modlauncher.Launcher.run(Launcher.java:82) [modlauncher-8.1.3.jar:?] {re:classloading}     at cpw.mods.modlauncher.Launcher.main(Launcher.java:66) [modlauncher-8.1.3.jar:?] {re:classloading} -- System Details -- Details:     Minecraft Version: 1.16.5     Minecraft Version ID: 1.16.5     Operating System: Windows 10 (amd64) version 10.0     Java Version: 1.8.0_51, Oracle Corporation     Java VM Version: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Oracle Corporation     Memory: 4067827920 bytes (3879 MB) / 6358564864 bytes (6064 MB) up to 10737418240 bytes (10240 MB)     CPUs: 12     JVM Flags: 9 total; -XX:+UnlockExperimentalVMOptions -XX:+UseG1GC -XX:G1NewSizePercent=20 -XX:G1ReservePercent=20 -XX:MaxGCPauseMillis=50 -XX:G1HeapRegionSize=16M -Xmx10240m -XX:HeapDumpPath=MojangTricksIntelDriversForPerformance_javaw.exe_minecraft.exe.heapdump -XX:+IgnoreUnrecognizedVMOptions     ModLauncher: 8.1.3+8.1.3+main-8.1.x.c94d18ec     ModLauncher launch target: fmlclient     ModLauncher naming: srg     ModLauncher services:          /mixin-0.8.4.jar mixin PLUGINSERVICE          /eventbus-4.0.0.jar eventbus PLUGINSERVICE          /forge-1.16.5-36.2.42.jar object_holder_definalize PLUGINSERVICE          /forge-1.16.5-36.2.42.jar runtime_enum_extender PLUGINSERVICE          /accesstransformers-3.0.1.jar accesstransformer PLUGINSERVICE          /forge-1.16.5-36.2.42.jar capability_inject_definalize PLUGINSERVICE          /forge-1.16.5-36.2.42.jar runtimedistcleaner PLUGINSERVICE          /mixin-0.8.4.jar mixin TRANSFORMATIONSERVICE          /forge-1.16.5-36.2.42.jar fml TRANSFORMATIONSERVICE      FML: 36.2     Forge: net.minecraftforge:36.2.42     FML Language Providers:          [email protected]         minecraft@1     Mod List:          SaveMyStronghold-1.16.4-1.0.jar                   |Save My Stronghold!           |savemystronghold              |1.16.4-1.0          |COMMON_SET|Manifest: NOSIGNATURE         create-stuff-additions1.16.5_v1.1.6.jar           |Create Stuff Additions        |create_stuff_additions        |1.1.6               |COMMON_SET|Manifest: NOSIGNATURE         mowziesmobs-1.5.27.jar                            |Mowzie's Mobs                 |mowziesmobs                   |1.5.27              |COMMON_SET|Manifest: NOSIGNATURE         blue_skies-1.16.5-1.1.3.jar                       |Blue Skies                    |blue_skies                    |1.1.3               |COMMON_SET|Manifest: NOSIGNATURE         supermartijn642configlib-1.1.8-forge-mc1.16.jar   |SuperMartijn642's Config Libra|supermartijn642configlib      |1.1.8               |COMMON_SET|Manifest: NOSIGNATURE         TrashSlot_1.16.3-12.2.1.jar                       |TrashSlot                     |trashslot                     |12.2.1              |COMMON_SET|Manifest: NOSIGNATURE         Tinkers Reforged 1.16.5-0.0.6.jar                 |Tinkers Reforged              |tinkers_reforged              |0.0.6               |COMMON_SET|Manifest: NOSIGNATURE         tinkersarchery-1.2.0.jar                          |Tinkers' Archery              |tinkersarchery                |1.2.0               |COMMON_SET|Manifest: NOSIGNATURE         rechiseled-1.1.6-forge-mc1.16.jar                 |Rechiseled                    |rechiseled                    |1.1.6               |COMMON_SET|Manifest: NOSIGNATURE         infernal-expansion-1.16.5-2.5.0.jar               |Infernal Expansion            |infernalexp                   |2.5.0               |COMMON_SET|Manifest: NOSIGNATURE         Bountiful Baubles FORGE-1.16.3-0.0.2.jar          |Bountiful Baubles             |bountifulbaubles              |NONE                |COMMON_SET|Manifest: NOSIGNATURE         TinkersLevellingAddon-1.16.5-1.1.1.jar            |Tinkers' Levelling Addon      |tinkerslevellingaddon         |1.1.1               |COMMON_SET|Manifest: NOSIGNATURE         libraryferret-forge-1.16.5-4.0.0.jar              |Library ferret                |libraryferret                 |4.0.0               |COMMON_SET|Manifest: NOSIGNATURE         stalwart-dungeons-1.16.5-1.1.7.jar                |Stalwart Dungeons             |stalwart_dungeons             |1.1.7               |COMMON_SET|Manifest: NOSIGNATURE         obscure_api-11.jar                                |Obscure API                   |obscure_api                   |11                  |COMMON_SET|Manifest: NOSIGNATURE         InsaneLib-1.4.2-mc1.16.5.jar                      |InsaneLib                     |insanelib                     |1.4.2               |COMMON_SET|Manifest: NOSIGNATURE         Waystones_1.16.5-7.6.4.jar                        |Waystones                     |waystones                     |7.6.4               |COMMON_SET|Manifest: NOSIGNATURE         journeymap-1.16.5-5.8.5p7.jar                     |Journeymap                    |journeymap                    |5.8.5p7             |COMMON_SET|Manifest: NOSIGNATURE         modernfix-forge-5.17.0+mc1.16.5.jar               |ModernFix                     |modernfix                     |5.17.0+mc1.16.5     |COMMON_SET|Manifest: NOSIGNATURE         jei-1.16.5-7.8.0.1011.jar                         |Just Enough Items             |jei                           |7.8.0.1011          |COMMON_SET|Manifest: NOSIGNATURE         citadel-1.8.1-1.16.5.jar                          |Citadel                       |citadel                       |1.8.1               |COMMON_SET|Manifest: NOSIGNATURE         alexsmobs-1.12.1.jar                              |Alex's Mobs                   |alexsmobs                     |1.12.1              |COMMON_SET|Manifest: NOSIGNATURE         Artifacts-1.16.5-2.10.5.jar                       |Artifacts                     |artifacts                     |1.16.5-2.10.5       |COMMON_SET|Manifest: NOSIGNATURE         OPF-1.16.x-v2.jar                                 |Online Picture Frame 2        |opf                           |0                   |COMMON_SET|Manifest: NOSIGNATURE         Obscuria's Tooltips 1.0.0.jar                     |Obscuria's Tooltips           |ob_tooltips                   |1.0.0               |COMMON_SET|Manifest: NOSIGNATURE         create-confectionery1.16.5_v1.0.2.jar             |Create Confectionery          |create_confectionery          |1.0.2               |COMMON_SET|Manifest: NOSIGNATURE         sophisticatedbackpacks-1.16.5-3.15.20.755.jar     |Sophisticated Backpacks       |sophisticatedbackpacks        |1.16.5-3.15.20.755  |COMMON_SET|Manifest: NOSIGNATURE         Desert Upgrade 1.2.7 - 1.16.5.jar                 |Desert Upgrade                |desert_upgrade                |1.2.7               |COMMON_SET|Manifest: NOSIGNATURE         ProgressiveBosses-3.4.3-mc1.16.5.jar              |Progressive Bosses            |progressivebosses             |3.4.3               |COMMON_SET|Manifest: NOSIGNATURE         mahoutsukai-1.16.5-v1.34.62.jar                   |Mahou Tsukai                  |mahoutsukai                   |1.16.5-v1.34.62     |COMMON_SET|Manifest: NOSIGNATURE         iceandfire-2.1.12-1.16.5-patch-1.jar              |Ice and Fire                  |iceandfire                    |2.1.12-1.16.5-patch-|COMMON_SET|Manifest: NOSIGNATURE         fusion-1.1.1-forge-mc1.16.jar                     |Fusion                        |fusion                        |1.1.1               |COMMON_SET|Manifest: NOSIGNATURE         immersive-armors-1.5.1+1.16.5-forge.jar           |Immersive Armors              |immersive_armors              |1.5.1+1.16.5        |COMMON_SET|Manifest: NOSIGNATURE         carryon-1.16.5-1.15.6.24.jar                      |Carry On                      |carryon                       |1.15.6.24           |COMMON_SET|Manifest: NOSIGNATURE         mysticalworld-1.16.5-0.3.6.27.jar                 |Mystical World                |mysticalworld                 |0.3.6.27            |COMMON_SET|Manifest: NOSIGNATURE         forge-1.16.5-36.2.42-universal.jar                |Forge                         |forge                         |36.2.42             |COMMON_SET|Manifest: 22:af:21:d8:19:82:7f:93:94:fe:2b:ac:b7:e4:41:57:68:39:87:b1:a7:5c:c6:44:f9:25:74:21:14:f5:0d:90         LostTrinkets-1.16.5-0.1.27.jar                    |Lost Trinkets                 |losttrinkets                  |0.1.27              |COMMON_SET|Manifest: NOSIGNATURE         dmcloot-1.16.5-beta-sept0722.jar                  |DMCLoot                       |dmcloot                       |1.16.5              |COMMON_SET|Manifest: NOSIGNATURE         BloodMagic-1.16.4-3.1.13-39.jar                   |Blood Magic                   |bloodmagic                    |1.16.4-3.1.13-39    |COMMON_SET|Manifest: NOSIGNATURE         chococraft-1.16.5-0.3.9.jar                       |Chococraft 4                  |chococraft                    |0.3.9               |COMMON_SET|Manifest: NOSIGNATURE         structure_gel-1.16.5-1.7.8.jar                    |Structure Gel API             |structure_gel                 |1.7.8               |COMMON_SET|Manifest: NOSIGNATURE         DungeonsArise-1.16.5-2.1.49-beta.jar              |When Dungeons Arise           |dungeons_arise                |2.1.49              |COMMON_SET|Manifest: NOSIGNATURE         CraftingTweaks_1.16.5-12.2.1.jar                  |Crafting Tweaks               |craftingtweaks                |12.2.1              |COMMON_SET|Manifest: NOSIGNATURE         dungeons_1.10.3_mc1.16.5.jar                      |Minecraft Dungeons            |duneons                       |1.10.3              |COMMON_SET|Manifest: NOSIGNATURE         forge-1.16.5-36.2.42-client.jar                   |Minecraft                     |minecraft                     |1.16.5              |COMMON_SET|Manifest: NOSIGNATURE         TConstruct-1.16.5-3.3.4.335.jar                   |Tinkers' Construct            |tconstruct                    |3.3.4.335           |COMMON_SET|Manifest: NOSIGNATURE         FarmersDelight-1.16.5-0.6.0.jar                   |Farmer's Delight              |farmersdelight                |1.16.5-0.6.0        |COMMON_SET|Manifest: NOSIGNATURE         culturaldelights-1.16.5-0.9.2.jar                 |Cultural Delights             |culturaldelights              |0.9.2               |COMMON_SET|Manifest: NOSIGNATURE         ends_delight-1.16.5-1.8.jar                       |End's Delight                 |ends_delight                  |1.16.5-1.8          |COMMON_SET|Manifest: NOSIGNATURE         tinker_rapier-1.1.4-1.16.5.jar                    |Tinkers' Rapier               |tinker_rapier                 |1.1.4-1.16.5        |COMMON_SET|Manifest: NOSIGNATURE         Jade-1.16.4-2.8.3.jar                             |Jade                          |jade                          |2.8.3               |COMMON_SET|Manifest: NOSIGNATURE         Lollipop-1.16.5-3.2.9.jar                         |Lollipop                      |lollipop                      |3.2.9               |COMMON_SET|Manifest: NOSIGNATURE         CreativeCore_v2.2.1_mc1.16.5.jar                  |CreativeCore                  |creativecore                  |2.0.0               |COMMON_SET|Manifest: NOSIGNATURE         supermartijn642corelib-1.1.17a-forge-mc1.16.jar   |SuperMartijn642's Core Lib    |supermartijn642corelib        |1.1.17a             |COMMON_SET|Manifest: NOSIGNATURE         Botania-1.16.5-420.3.jar                          |Botania                       |botania                       |1.16.5-420.3        |COMMON_SET|Manifest: NOSIGNATURE         born_in_chaos_1.16_1.3.jar                        |Born in Chaos                 |born_in_chaos_v1              |1.0.0               |COMMON_SET|Manifest: NOSIGNATURE         jeiintegration_1.16.5-7.1.0.22.jar                |JEI Integration               |jeiintegration                |7.1.0.22            |COMMON_SET|Manifest: NOSIGNATURE         TheForbidden-1.0.2-ByShadowMech.jar               |The Forbidden                 |theforbidden                  |1.0.1               |COMMON_SET|Manifest: NOSIGNATURE         Goblins_Dungeons_1.0.6-1.16.jar                   |Goblins & Dungeons            |goblinsanddungeons            |1.0.6               |COMMON_SET|Manifest: NOSIGNATURE         L_Enders Cataclysm-0.48 Changed Theme -1.16.5.jar |Cataclysm Mod                 |cataclysm                     |1.0                 |COMMON_SET|Manifest: NOSIGNATURE         flywheel-1.16-0.2.5.jar                           |Flywheel                      |flywheel                      |1.16-0.2.5          |COMMON_SET|Manifest: NOSIGNATURE         create-mc1.16.5_v0.3.2g.jar                       |Create                        |create                        |v0.3.2g             |COMMON_SET|Manifest: NOSIGNATURE         createdeco-1.1.2-1.16.5.jar                       |Create Deco                   |createdeco                    |1.1.2-1.16.5        |COMMON_SET|Manifest: NOSIGNATURE         curios-forge-1.16.5-4.1.0.0.jar                   |Curios API                    |curios                        |1.16.5-4.1.0.0      |COMMON_SET|Manifest: NOSIGNATURE         Atum-1.16.5-2.2.12.jar                            |Atum 2                        |atum                          |1.16.5-2.2.12       |COMMON_SET|Manifest: NOSIGNATURE         SpartanShields-1.16.5-2.1.2.jar                   |Spartan Shields               |spartanshields                |2.1.2               |COMMON_SET|Manifest: NOSIGNATURE         Patchouli-1.16.4-53.3.jar                         |Patchouli                     |patchouli                     |1.16.4-53.3         |VALIDATE  |Manifest: NOSIGNATURE         Mantle-1.16.5-1.6.157.jar                         |Mantle                        |mantle                        |1.6.157             |COMMON_SET|Manifest: NOSIGNATURE         arsomega-1.5.jar                                  |Ars Omega                     |arsomega                      |1.16.5-1.5          |COMMON_SET|Manifest: NOSIGNATURE         AutoRegLib-1.6-49.jar                             |AutoRegLib                    |autoreglib                    |1.6-49              |COMMON_SET|Manifest: NOSIGNATURE         Quark-r2.4-322.jar                                |Quark                         |quark                         |r2.4-322            |COMMON_SET|Manifest: NOSIGNATURE         [1.16.5] SecurityCraft v1.9.9.jar                 |SecurityCraft                 |securitycraft                 |v1.9.9              |COMMON_SET|Manifest: NOSIGNATURE         elevatorid-1.16.5-1.7.13.jar                      |Elevator Mod                  |elevatorid                    |1.16.5-1.7.13       |COMMON_SET|Manifest: NOSIGNATURE         tombstone-1.16.5-6.8.16.jar                       |Corail Tombstone              |tombstone                     |6.8.16              |COMMON_SET|Manifest: NOSIGNATURE         Argentina's delight 1.16.5 (3.0 beta).jar         |Argentina's Delight           |argentinas_delight            |1.3                 |COMMON_SET|Manifest: NOSIGNATURE         swiaf-1.16.5-1.1.2.jar                            |Spartan Weaponry: Ice and Fire|swiaf                         |1.16.5-1.1.2        |COMMON_SET|Manifest: NOSIGNATURE         TheAbyss2 2.2.3-4 1.16.5.jar                      |TheAbyss                      |theabyss                      |2.2.3-4             |COMMON_SET|Manifest: NOSIGNATURE         SpartanWeaponry-1.16.5-2.2.2.jar                  |Spartan Weaponry              |spartanweaponry               |2.2.2               |COMMON_SET|Manifest: NOSIGNATURE         architectury-1.32.68.jar                          |Architectury                  |architectury                  |1.32.68             |COMMON_SET|Manifest: NOSIGNATURE         lootr-1.16.5-0.2.19.51.jar                        |Lootr                         |lootr                         |0.2.19.51           |COMMON_SET|Manifest: NOSIGNATURE         ferritecore-2.1.1-forge.jar                       |Ferrite Core                  |ferritecore                   |2.1.1               |COMMON_SET|Manifest: 41:ce:50:66:d1:a0:05:ce:a1:0e:02:85:9b:46:64:e0:bf:2e:cf:60:30:9a:fe:0c:27:e0:63:66:9a:84:ce:8a         moredragoneggs-2.5.jar                            |More Dragon Eggs              |moredragoneggs                |2.5                 |COMMON_SET|Manifest: NOSIGNATURE         cloth-config-4.17.101-forge.jar                   |Cloth Config v4 API           |cloth-config                  |4.17.101            |COMMON_SET|Manifest: NOSIGNATURE         PuzzlesLib-v1.0.15-1.16.5-Forge.jar               |Puzzles Lib                   |puzzleslib                    |1.0.15              |COMMON_SET|Manifest: 9a:09:85:98:65:c4:8c:11:c5:49:f6:d6:33:23:39:df:8d:b4:ff:92:84:b8:bd:a5:83:9f:ac:7f:2a:d1:4b:6a         the_bumblezone_forge-3.2.1+1.16.5.jar             |The Bumblezone                |the_bumblezone                |3.2.1+1.16.5        |COMMON_SET|Manifest: NOSIGNATURE         Obscuria's Essentials 3.0.0.jar                   |Obscuria's Essentials         |ob_core                       |3.0.0               |COMMON_SET|Manifest: NOSIGNATURE         Blood-Smeltery-1.16.5-1.1.5a.jar                  |Blood Smeltery                |bloodsmeltery                 |1.1.5a              |COMMON_SET|Manifest: NOSIGNATURE         expandability-2.0.1-forge.jar                     |ExpandAbility                 |expandability                 |2.0.1               |COMMON_SET|Manifest: NOSIGNATURE         JustEnoughGolems - Magma Release (v2.2.1-HF) 1.16.|JustEnoughGolems              |justenoughgolems              |Magma Release (v2.2.|COMMON_SET|Manifest: NOSIGNATURE         PlayerRevive_v2.0.0-pre04_mc1.16.5.jar            |PlayerRevive                  |playerrevive                  |2.0.0               |COMMON_SET|Manifest: NOSIGNATURE         geckolib-forge-1.16.5-3.0.106.jar                 |GeckoLib                      |geckolib3                     |3.0.106             |COMMON_SET|Manifest: NOSIGNATURE         ars_nouveau-1.16.5-1.25.10.jar                    |Ars Nouveau                   |ars_nouveau                   |1.25.10             |COMMON_SET|Manifest: NOSIGNATURE         EnchantingInfuser-v1.0.2-1.16.5-Forge.jar         |Enchanting Infuser            |enchantinginfuser             |1.0.2               |COMMON_SET|Manifest: 9a:09:85:98:65:c4:8c:11:c5:49:f6:d6:33:23:39:df:8d:b4:ff:92:84:b8:bd:a5:83:9f:ac:7f:2a:d1:4b:6a         aquamirae-5.4.API11.jar                           |Aquamirae                     |aquamirae                     |5.4.API11           |COMMON_SET|Manifest: NOSIGNATURE         createaddition-1.16.5-20220129a.jar               |Create Crafts & Additions     |createaddition                |1.16.5-20220129a    |COMMON_SET|Manifest: NOSIGNATURE         xptome-1.16.5-v2.1.5.jar                          |XP Tome                       |xpbook                        |v2.1.5              |COMMON_SET|Manifest: NOSIGNATURE     Crash Report UUID: 57fb9766-0046-4b87-ace9-446de1e70ad0     Launched Version: 1.16.5-forge-36.2.42     Backend library: LWJGL version 3.2.2 build 10     Backend API: NVIDIA GeForce RTX 2060 SUPER/PCIe/SSE2 GL version 4.6.0 NVIDIA 555.85, NVIDIA Corporation     GL Caps: Using framebuffer using OpenGL 3.0     Using VBOs: Yes     Is Modded: Definitely; Client brand changed to 'forge'     Type: Client (map_client.txt)     CPU: 12x AMD Ryzen 5 5600G with Radeon Graphics 
    • Im having this problem where i open the run.bat file with the following code: "C:\Program Files\Java\jre-1.8\bin\javaw.exe" -Xmx6000M -Xms6000M -jar forge-1.12.2-14.23.5.2860.jar nogui PAUSE This creates all the folders and files that it would normally create (eula.txt, mods, server.properties, etc) but it wont generate a world, the eula has been accepted, but it still does nothing, and it wont say anything on the cmd besides leaving a blank paragraph and the PAUSE code. I dont know what to do, i updated the last version of java 8, i tried many forge versions, including the latest, the recomended and a few others, i restarted my pc various times, nothing. Normal vanilla servers work just fine, its the forge one that doesnt do the thing. Im desperate, i've been trying to create a 1.20.2 server and for some reason every tweak i made for ram usage never worked, it still used 1gb to 3gb max, world not loading correctly, countless ticks behind. try a 1.12.2 server, got nowhere, and the weirdest thing is that i already made some 1.12.2 forge servers on this same pc a few years ago and had no trouble at all. if anybody knows what is happening please leave a comment, i will thank you with all my heart.
    • We've actually started running into a new problem, whilst adding more mods may work, it makes it so that we're unable to connect to our server, even on LAN. Does anyone know what this error message means? We're not getting any helpful output into console either. Edit: found the logs for attempting to connect [21:46:00] [Netty Epoll Client IO #0/WARN]: Your custom tfmg:coking recipe (tfmg:coking/coal_coke) specified a duration. Durations have no impact on this type of recipe. [21:46:00] [Render thread/INFO]: Reloaded entity icon resources! [21:46:00] [Netty Epoll Client IO #0/WARN]: Your custom createaddition:rolling/copper_plate recipe (createaddition:rolling/copper_plate) specified a duration. Durations have no impact on this type of recipe. [21:46:00] [Render thread/INFO]: Redirecting net/minecraft/world/level/chunk/LevelChunk$EntityCreationType [21:46:00] [Render thread/INFO]: Redirecting com/possible_triangle/flightlib/api/FlyingPose [21:46:00] [Render thread/INFO]: Redirecting net/minecraft/world/BossEvent$BossBarColor [21:46:00] [Render thread/INFO]: Redirecting fuzs/overflowingbars/client/handler/HealthBarRenderer$HeartType [21:46:00] [Render thread/INFO]: Curios has been initialized with 17 slot(s) after 1 tries [21:46:00] [Render thread/INFO]: Redirecting org/violetmoon/quark/api/event/UsageTickerEvent$Pass [21:46:00] [Render thread/INFO]: Redirecting net/minecraft/world/level/block/SupportType [21:46:00] [Render thread/INFO]: Redirecting com/tom/cpm/shared/MinecraftClientAccess$ServerStatus [21:46:00] [Render thread/INFO]: Redirecting io/socol/betterthirdperson/api/TickPhase [21:46:00] [Render thread/INFO]: Redirecting net/minecraft/world/scores/Team$CollisionRule [21:46:00] [Render thread/INFO]: Redirecting net/blf02/vrapi/client/VRDataGrabber$PlayerType [21:46:00] [Render thread/INFO]: Redirecting com/corosus/watut/PlayerStatus$PlayerChatState [21:46:00] [Render thread/WARN]: Unable to play empty soundEvent: biomemusic:music.game [21:46:01] [Render thread/INFO]: Stopping worker threads [21:46:01] [Render thread/INFO]: Started 6 worker threads [21:46:01] [Netty Epoll Client IO #0/WARN]: Your custom createaddition:rolling/electrum_ingot recipe (createaddition:rolling/electrum_ingot) specified a duration. Durations have no impact on this type of recipe. [21:46:01] [Netty Epoll Client IO #0/WARN]: Your custom tfmg:casting recipe (tfmg:casting/steel) specified a duration. Durations have no impact on this type of recipe. [21:46:01] [Netty Epoll Client IO #0/WARN]: Your custom tfmg:casting recipe (tfmg:casting/steel) has more fluid inputs (1) than supported (0). [21:46:01] [Netty Epoll Client IO #0/WARN]: Your custom createaddition:rolling/brass_ingot recipe (createaddition:rolling/brass_ingot) specified a duration. Durations have no impact on this type of recipe. [21:46:01] [Render thread/INFO]: Redirecting net/minecraft/client/gui/components/toasts/Toast$Visibility [21:46:01] [CullThread/INFO]: Redirecting com/logisticscraft/occlusionculling/OcclusionCullingInstance$Relative [21:46:01] [Netty Epoll Client IO #0/WARN]: Your custom createaddition:rolling/electrum_plate recipe (createaddition:rolling/electrum_plate) specified a duration. Durations have no impact on this type of recipe. [21:46:01] [Netty Epoll Client IO #0/WARN]: Your custom createaddition:rolling/gold_plate recipe (createaddition:rolling/gold_plate) specified a duration. Durations have no impact on this type of recipe. [21:46:01] [Netty Epoll Client IO #0/WARN]: Your custom createaddition:rolling/gold_ingot recipe (createaddition:rolling/gold_ingot) specified a duration. Durations have no impact on this type of recipe. [21:46:01] [Netty Epoll Client IO #0/WARN]: Your custom createaddition:rolling/iron_plate recipe (createaddition:rolling/iron_plate) specified a duration. Durations have no impact on this type of recipe. [21:46:01] [Netty Epoll Client IO #0/WARN]: Your custom createaddition:rolling/iron_ingot recipe (createaddition:rolling/iron_ingot) specified a duration. Durations have no impact on this type of recipe. [21:46:02] [Netty Epoll Client IO #0/WARN]: Your custom tfmg:industrial_blasting recipe (tfmg:industrial_blasting/steel) specified a duration. Durations have no impact on this type of recipe. [21:46:02] [Netty Epoll Client IO #0/WARN]: Your custom createaddition:rolling/copper_ingot recipe (createaddition:rolling/copper_ingot) specified a duration. Durations have no impact on this type of recipe. [21:46:02] [Netty Epoll Client IO #0/WARN]: Your custom createaddition:rolling/straw recipe (createaddition:rolling/straw) specified a duration. Durations have no impact on this type of recipe. [21:46:02] [Netty Epoll Client IO #0/INFO]: Redirecting net/minecraft/world/entity/RelativeMovement [21:46:02] [Netty Epoll Client IO #0/INFO]: Redirecting dev/xkmc/l2library/capability/player/PlayerCapToClient$Action [21:46:02] [Render thread/WARN]: Unknown recipe category: cataclysm:weapon_fusion/cataclysm:weapon_infusion/void_assault_shoulder_weapon [21:46:03] [Netty Epoll Client IO #0/WARN]: Packet not registered: ClientboundDisconnectPacket [21:46:03] [Netty Epoll Client IO #0/WARN]: Packet:ClientboundDisconnectPacket [21:46:03] [Netty Epoll Client IO #0/WARN]: Packet data: { "f_132075_": "translation{key='disconnect.genericReason', args=[Internal Exception: io.netty.handler.codec.DecoderException: java.lang.IndexOutOfBoundsException: readerIndex(12) + length(8) exceeds writerIndex(13): PooledUnsafeDirectByteBuf(ridx: 12, widx: 13, cap: 13/14)]}" } [21:46:03] [Render thread/WARN]: Unknown recipe category: deep_aether:poison_recipe/deep_aether:golden_dart_from_poison [21:46:03] [Render thread/WARN]: Unknown recipe category: deep_aether:poison_recipe/deep_aether:holystone_from_poison [21:46:03] [Render thread/WARN]: Unknown recipe category: deep_aether:poison_recipe/deep_aether:gravitite_ore_from_poison [21:46:03] [Render thread/WARN]: Unknown recipe category: deep_aether:poison_recipe/deep_aether:purple_squash_from_blue_squash [21:46:03] [Render thread/WARN]: Unknown recipe category: cataclysm:weapon_fusion/cataclysm:weapon_infusion/gauntlet_of_bulwark [21:46:03] [Render thread/WARN]: Unknown recipe category: cataclysm:weapon_fusion/cataclysm:weapon_infusion/void_forge [21:46:03] [Render thread/WARN]: Unknown recipe category: deep_aether:poison_recipe/deep_aether:quicksoil_from_poison [21:46:03] [Render thread/WARN]: Unknown recipe category: deep_aether:poison_recipe/deep_aether:blueberry_from_poison [21:46:03] [Render thread/WARN]: Unknown recipe category: deep_aether:poison_recipe/deep_aether:skyroot_poison_bucket_from_poison [21:46:03] [Render thread/WARN]: Unknown recipe category: cataclysm:weapon_fusion/cataclysm:weapon_infusion/ignitium_elytra_chestplate [21:46:03] [Render thread/WARN]: Unknown recipe category: deep_aether:poison_recipe/deep_aether:purple_squash_from_green_squash  
  • Topics

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.