Jump to content

Entity AI: Getting Custom Mob to attack vanilla creatures


Mikethecoder4

Recommended Posts

I made a custom mob (called an infected) which is essentially a zombie that does't burn in the sun. Im trying to get it to attack passive mobs (like cows, sheep, etc.) as well as players and villagers. However, nothing I do seems to be working.

 

 

I've tried adding the following code into the constructor :

 

this.targetTasks.addTask(2, new EntityAINearestAttackableTarget(this, EntityCow.class, 0, false));

 

But that doesnt seem to work. I have tried using different priorities, removing all the target tasks but that one, and looked though the various classes that make up AI. I'm at a loss for what to do at this point. My Mob is extending the EntityMob class.

 

Here is my full infected classes

 

public class infected extends EntityMob{

protected static final Attribute field_110186_bp = (new RangedAttribute("zombie.spawnReinforcements", 0.0D, 0.0D, 1.0D)).func_111117_a("Spawn Reinforcements Chance");
    private static final UUID babySpeedBoostUUID = UUID.fromString("B9766B59-9566-4402-BC1F-2EE2A276D836");
    private static final AttributeModifier babySpeedBoostModifier = new AttributeModifier(babySpeedBoostUUID, "Baby speed boost", 0.5D, 1);

    /**
     * Ticker used to determine the time remaining for this zombie to convert into a villager when cured.
     */
    private int conversionTime;

    public infected(World par1World)
    {
        super(par1World);
        this.getNavigator().setBreakDoors(true);
        this.getNavigator().setEnterDoors(true);

        //this.tasks.addTask(0, new EntityAISwimming(this));
        this.tasks.addTask(0, new EntityAIBreakDoor(this));
        this.tasks.addTask(1, new EntityAIAttackOnCollide(this, EntityPlayer.class, 1.0D, false));
        this.tasks.addTask(2, new EntityAIAttackOnCollide(this, EntityVillager.class, 1.0D, true));
        this.tasks.addTask(3, new EntityAIMoveTowardsRestriction(this, 1.0D));
        this.tasks.addTask(4, new EntityAIMoveThroughVillage(this, 1.0D, false));
        this.tasks.addTask(5, new EntityAIWander(this, 1.0D));
        this.tasks.addTask(6, new EntityAIWatchClosest(this, EntityPlayer.class, 8.0F));
        this.tasks.addTask(7, new EntityAILookIdle(this));
        this.targetTasks.addTask(1, new EntityAIHurtByTarget(this, true));
        //this.targetTasks.addTask(3, new EntityAINearestAttackableTarget(this, EntityPlayer.class, 0, true));
        this.targetTasks.addTask(2, new EntityAINearestAttackableTarget(this, EntityVillager.class, 0, false));
        this.targetTasks.addTask(2, new EntityAINearestAttackableTarget(this, EntityCow.class, 0, false));
        this.targetTasks.addTask(3, new EntityAINearestAttackableTarget(this, EntityPlayer.class, 0, true)); 
    }

    protected void applyEntityAttributes()
    {
        super.applyEntityAttributes();
        this.getEntityAttribute(SharedMonsterAttributes.followRange).setAttribute(18.0D);
        this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setAttribute(0.44000700417232513D);
        this.getEntityAttribute(SharedMonsterAttributes.attackDamage).setAttribute(4.0D);
        this.getAttributeMap().func_111150_b(field_110186_bp).setAttribute(this.rand.nextDouble() * 0.10000000149011612D);
    }

    protected void entityInit()
    {
        super.entityInit();
        this.getDataWatcher().addObject(12, Byte.valueOf((byte)0));
        this.getDataWatcher().addObject(13, Byte.valueOf((byte)0));
        this.getDataWatcher().addObject(14, Byte.valueOf((byte)0));
    }

    /**
     * Returns the current armor value as determined by a call to InventoryPlayer.getTotalArmorValue
     */
    public int getTotalArmorValue()
    {
        int i = super.getTotalArmorValue() + 2;

        if (i > 20)
        {
            i = 20;
        }

        return i;
    }

    /**
     * Returns true if the newer Entity AI code should be run
     */
    protected boolean isAIEnabled()
    {
        return true;
    }
    
    @Override
    public boolean canAttackClass(Class par1Class)
    {
        return true;
    }


   
    @Override
    public void onLivingUpdate()
    {
    	
    	

        //EntityLiving.onLivingUpdate();
        super.onLivingUpdate();
    }
    
        
        public boolean attackEntityFrom(DamageSource par1DamageSource, float par2)
        {
            if (!super.attackEntityFrom(par1DamageSource, par2))
            {
                return false;
            }
            else
            {
                EntityLivingBase entitylivingbase = this.getAttackTarget();

                if (entitylivingbase == null && this.getEntityToAttack() instanceof EntityLivingBase)
                {
                    entitylivingbase = (EntityLivingBase)this.getEntityToAttack();
                }

                if (entitylivingbase == null && par1DamageSource.getEntity() instanceof EntityLivingBase)
                {
                    entitylivingbase = (EntityLivingBase)par1DamageSource.getEntity();
                }

                if (entitylivingbase != null && this.worldObj.difficultySetting >= 3 && (double)this.rand.nextFloat() < this.getEntityAttribute(field_110186_bp).getAttributeValue())
                {
                    int i = MathHelper.floor_double(this.posX);
                    int j = MathHelper.floor_double(this.posY);
                    int k = MathHelper.floor_double(this.posZ);
                    infected entityzombie = new infected(this.worldObj);

                    for (int l = 0; l < 50; ++l)
                    {
                        int i1 = i + MathHelper.getRandomIntegerInRange(this.rand, 7, 40) * MathHelper.getRandomIntegerInRange(this.rand, -1, 1);
                        int j1 = j + MathHelper.getRandomIntegerInRange(this.rand, 7, 40) * MathHelper.getRandomIntegerInRange(this.rand, -1, 1);
                        int k1 = k + MathHelper.getRandomIntegerInRange(this.rand, 7, 40) * MathHelper.getRandomIntegerInRange(this.rand, -1, 1);

                        if (this.worldObj.doesBlockHaveSolidTopSurface(i1, j1 - 1, k1) && this.worldObj.getBlockLightValue(i1, j1, k1) < 10)
                        {
                            entityzombie.setPosition((double)i1, (double)j1, (double)k1);

                            if (this.worldObj.checkNoEntityCollision(entityzombie.boundingBox) && this.worldObj.getCollidingBoundingBoxes(entityzombie, entityzombie.boundingBox).isEmpty() && !this.worldObj.isAnyLiquid(entityzombie.boundingBox))
                            {
                                this.worldObj.spawnEntityInWorld(entityzombie);
                                entityzombie.setAttackTarget(entitylivingbase);
                                entityzombie.onSpawnWithEgg((EntityLivingData)null);
                                this.getEntityAttribute(field_110186_bp).applyModifier(new AttributeModifier("Zombie reinforcement caller charge", -0.05000000074505806D, 0));
                                entityzombie.getEntityAttribute(field_110186_bp).applyModifier(new AttributeModifier("Zombie reinforcement callee charge", -0.05000000074505806D, 0));
                                break;
                            }
                        }
                    }
                }

                return true;
            }
        }

        /**
         * Called to update the entity's position/logic.
         */
        public void onUpdate()
        {
            if (!this.worldObj.isRemote && this.isConverting())
            {
                int i = this.getConversionTimeBoost();
                this.conversionTime -= i;

                if (this.conversionTime <= 0)
                {
                    this.convertToVillager();
                }
            }

            super.onUpdate();
        }

        public boolean attackEntityAsMob(Entity par1Entity)
        {
            boolean flag = super.attackEntityAsMob(par1Entity);

            if (flag && this.getHeldItem() == null && this.isBurning() && this.rand.nextFloat() < (float)this.worldObj.difficultySetting * 0.3F)
            {
                par1Entity.setFire(2 * this.worldObj.difficultySetting);
            }

            return flag;
        }

        /**
         * Returns the sound this mob makes while it's alive.
         */
        protected String getLivingSound()
        {
            return "mob.zombie.say";
        }

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

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

        /**
         * Plays step sound at given x, y, z for the entity
         */
        protected void playStepSound(int par1, int par2, int par3, int par4)
        {
            this.playSound("mob.zombie.step", 0.15F, 1.0F);
        }

        /**
         * Returns the item ID for the item the mob drops on death.
         */
        protected int getDropItemId()
        {
            return Item.rottenFlesh.itemID;
        }

        /**
         * Get this Entity's EnumCreatureAttribute
         */
        public EnumCreatureAttribute getCreatureAttribute()
        {
            return EnumCreatureAttribute.UNDEAD;
        }

        protected void dropRareDrop(int par1)
        {
            switch (this.rand.nextInt(3))
            {
                case 0:
                    this.dropItem(Item.ingotIron.itemID, 1);
                    break;
                case 1:
                    this.dropItem(Item.carrot.itemID, 1);
                    break;
                case 2:
                    this.dropItem(Item.potato.itemID, 1);
            }
        }

        /**
         * Makes entity wear random armor based on difficulty
         */
        protected void addRandomArmor()
        {
            super.addRandomArmor();

            if (this.rand.nextFloat() < (this.worldObj.difficultySetting == 3 ? 0.05F : 0.01F))
            {
                int i = this.rand.nextInt(3);

                if (i == 0)
                {
                    this.setCurrentItemOrArmor(0, new ItemStack(Item.swordIron));
                }
                else
                {
                    this.setCurrentItemOrArmor(0, new ItemStack(Item.shovelIron));
                }
            }
        }

        /**
         * (abstract) Protected helper method to write subclass entity data to NBT.
         */
        public void writeEntityToNBT(NBTTagCompound par1NBTTagCompound)
        {
            super.writeEntityToNBT(par1NBTTagCompound);
            /*
            if (this.isChild())
            {
                par1NBTTagCompound.setBoolean("IsBaby", true);
            }

            if (this.isVillager())
            {
                par1NBTTagCompound.setBoolean("IsVillager", true);
            }

            par1NBTTagCompound.setInteger("ConversionTime", this.isConverting() ? this.conversionTime : -1);
           */
        }

        /**
         * (abstract) Protected helper method to read subclass entity data from NBT.
         */
        public void readEntityFromNBT(NBTTagCompound par1NBTTagCompound)
        {
            super.readEntityFromNBT(par1NBTTagCompound);
            /*
            if (par1NBTTagCompound.getBoolean("IsBaby"))
            {
                this.setChild(true);
            }

            if (par1NBTTagCompound.getBoolean("IsVillager"))
            {
                this.setVillager(true);
            }

            if (par1NBTTagCompound.hasKey("ConversionTime") && par1NBTTagCompound.getInteger("ConversionTime") > -1)
            {
                this.startConversion(par1NBTTagCompound.getInteger("ConversionTime"));
            }
            */
        }

        /**
         * This method gets called when the entity kills another one.
         */
        public void onKillEntity(EntityLivingBase par1EntityLivingBase)
        {
            super.onKillEntity(par1EntityLivingBase);

            if (this.worldObj.difficultySetting >= 2 && par1EntityLivingBase instanceof EntityVillager)
            {
                if (this.worldObj.difficultySetting == 2 && this.rand.nextBoolean())
                {
                    return;
                }

                infected entityzombie = new infected(this.worldObj);
                entityzombie.copyLocationAndAnglesFrom(par1EntityLivingBase);
                this.worldObj.removeEntity(par1EntityLivingBase);
                entityzombie.onSpawnWithEgg((EntityLivingData)null);
                //entityzombie.setVillager(true);

                //if (par1EntityLivingBase.isChild())
               // {
                   // entityzombie.setChild(true);
               // }

                this.worldObj.spawnEntityInWorld(entityzombie);
                this.worldObj.playAuxSFXAtEntity((EntityPlayer)null, 1016, (int)this.posX, (int)this.posY, (int)this.posZ, 0);
            }
        }

        public EntityLivingData onSpawnWithEgg(EntityLivingData par1EntityLivingData)
        {
            Object par1EntityLivingData1 = super.onSpawnWithEgg(par1EntityLivingData);
            float f = this.worldObj.getLocationTensionFactor(this.posX, this.posY, this.posZ);
            this.setCanPickUpLoot(true);
            
            if (par1EntityLivingData1 == null)
            {
                par1EntityLivingData1 = new infectedGroupData(this, this.worldObj.rand.nextFloat() < 0.05F, this.worldObj.rand.nextFloat() < 0.05F, (infectedINNER1)null);
            }

            if (par1EntityLivingData1 instanceof infectedGroupData)
            {
            	infectedGroupData entityzombiegroupdata = (infectedGroupData)par1EntityLivingData1;

                /*if (entityzombiegroupdata.field_142046_b)
                {
                    this.setVillager(true);
                }

                if (entityzombiegroupdata.field_142048_a)
                {
                    this.setChild(true);
                }
                */
            }
            

            this.addRandomArmor();
            this.enchantEquipment();

            if (this.getCurrentItemOrArmor(4) == null)
            {
                Calendar calendar = this.worldObj.getCurrentDate();

                if (calendar.get(2) + 1 == 10 && calendar.get(5) == 31 && this.rand.nextFloat() < 0.25F)
                {
                    this.setCurrentItemOrArmor(4, new ItemStack(this.rand.nextFloat() < 0.1F ? Block.pumpkinLantern : Block.pumpkin));
                    this.equipmentDropChances[4] = 0.0F;
                }
            }

            this.getEntityAttribute(SharedMonsterAttributes.knockbackResistance).applyModifier(new AttributeModifier("Random spawn bonus", this.rand.nextDouble() * 0.05000000074505806D, 0));
            this.getEntityAttribute(SharedMonsterAttributes.followRange).applyModifier(new AttributeModifier("Random zombie-spawn bonus", this.rand.nextDouble() * 1.5D, 2));

            if (this.rand.nextFloat() < f * 0.05F)
            {
                this.getEntityAttribute(field_110186_bp).applyModifier(new AttributeModifier("Leader zombie bonus", this.rand.nextDouble() * 0.25D + 0.5D, 0));
                this.getEntityAttribute(SharedMonsterAttributes.maxHealth).applyModifier(new AttributeModifier("Leader zombie bonus", this.rand.nextDouble() * 3.0D + 1.0D, 2));
            }

            return (EntityLivingData)par1EntityLivingData1;
        }

        /**
         * 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.getCurrentEquippedItem();
            /* no converting them
            if (itemstack != null && itemstack.getItem() == Item.appleGold && itemstack.getItemDamage() == 0  && this.isPotionActive(Potion.weakness))
            {
                if (!par1EntityPlayer.capabilities.isCreativeMode)
                {
                    --itemstack.stackSize;
                }

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

                if (!this.worldObj.isRemote)
                {
                    this.startConversion(this.rand.nextInt(2401) + 3600);
                }

                return true;
            }
            else
            {
                return false;
            }*/
            return false;
        }

        /**
         * Starts converting this zombie into a villager. The zombie converts into a villager after the specified time in
         * ticks.
         */
        protected void startConversion(int par1)
        {
            this.conversionTime = par1;
            this.getDataWatcher().updateObject(14, Byte.valueOf((byte)1));
            this.removePotionEffect(Potion.weakness.id);
            this.addPotionEffect(new PotionEffect(Potion.damageBoost.id, par1, Math.min(this.worldObj.difficultySetting - 1, 0)));
            this.worldObj.setEntityState(this, (byte)16);
        }

        @SideOnly(Side.CLIENT)
        public void handleHealthUpdate(byte par1)
        {
            if (par1 == 16)
            {
                this.worldObj.playSound(this.posX + 0.5D, this.posY + 0.5D, this.posZ + 0.5D, "mob.zombie.remedy", 1.0F + this.rand.nextFloat(), this.rand.nextFloat() * 0.7F + 0.3F, false);
            }
            else
            {
                super.handleHealthUpdate(par1);
            }
        }

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

        /**
         * Returns whether this zombie is in the process of converting to a villager
         */
        public boolean isConverting()
        {
            return false;//this.getDataWatcher().getWatchableObjectByte(14) == 1;
        }

        /**
         * Convert this zombie into a villager.
         */
        protected void convertToVillager()
        {
            EntityVillager entityvillager = new EntityVillager(this.worldObj);
            entityvillager.copyLocationAndAnglesFrom(this);
            entityvillager.onSpawnWithEgg((EntityLivingData)null);
            entityvillager.func_82187_q();

            if (this.isChild())
            {
                entityvillager.setGrowingAge(-24000);
            }

            this.worldObj.removeEntity(this);
            this.worldObj.spawnEntityInWorld(entityvillager);
            entityvillager.addPotionEffect(new PotionEffect(Potion.confusion.id, 200, 0));
            this.worldObj.playAuxSFXAtEntity((EntityPlayer)null, 1017, (int)this.posX, (int)this.posY, (int)this.posZ, 0);
        }

        /**
         * Return the amount of time decremented from conversionTime every tick.
         */
        protected int getConversionTimeBoost()
        {
            int i = 1;

            if (this.rand.nextFloat() < 0.01F)
            {
                int j = 0;

                for (int k = (int)this.posX - 4; k < (int)this.posX + 4 && j < 14; ++k)
                {
                    for (int l = (int)this.posY - 4; l < (int)this.posY + 4 && j < 14; ++l)
                    {
                        for (int i1 = (int)this.posZ - 4; i1 < (int)this.posZ + 4 && j < 14; ++i1)
                        {
                            int j1 = this.worldObj.getBlockId(k, l, i1);

                            if (j1 == Block.fenceIron.blockID || j1 == Block.bed.blockID)
                            {
                                if (this.rand.nextFloat() < 0.3F)
                                {
                                    ++i;
                                }

                                ++j;
                            }
                        }
                    }
                }
            }

            return i;
        }
        
        @Override
        protected Entity findPlayerToAttack()
        {
            EntityPlayer entityplayer = this.worldObj.getClosestVulnerablePlayerToEntity(this, 8.0D);
            return entityplayer != null && this.canEntityBeSeen(entityplayer) ? entityplayer : null;
        }

}

Link to comment
Share on other sites

do you mean this function?

 

@Override
    protected boolean isAIEnabled()
    {
        return true;
    }

or a different one? I tried this and it didn't work. still won't attack cows.

 

I've noticed that they will only attack villagers and the player, and won't attack spiders, creepers, zombies, themselves, etc. I haven't tried EVERY mob, but that ones I have tried its all the same.

 

Also, if you do have the ai targetting a mob, and its a higher priority than villager/player, it will be docile. If you put its priority above the HurtByTarget AI task, it basically becomes passive (but doesn't panic).

Link to comment
Share on other sites

I have played around with this concept a bit recently and figured out, for it to attack a mob you have to have BOTH the collision task and the attackable task

 

so you have to have both these:

this.tasks.addTask(2, new EntityAIAttackOnCollide(this, EntityCow.class, 1.0D, true));
this.targetTasks.addTask(2, new EntityAINearestAttackableTarget(this, EntityCow.class, 0, false));

 

try that, i imagine that is you problem.

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

    • Hi, I am trying to get custom GUIs working, and I would like to have a GUI that works only client-side, which means that you are not supposed to pull items out, but I do want to display items in my GUI and let the player click them. I have a GUI working that has a size of 54 slots and I made a custom texture to remove the player inventory from the GUI texture (see image) Everything kinda works, but is seems like the inventory is in some way still linked to the player's inventory, even though I didn't add any slots linked to the player's inventory. As an example: If is click in the 5th row of my GUI, I get the chest that was in my hot bar slot (see image). It seems like the handling of the clicking of the inventory is handled by the player inventory still. I also get an error if I click in the bottom row because "java.lang.IndexOutOfBoundsException: Index: 49, Size: 45" the player inventory has a size of 45 I guess? I have posted all my relevant code below, if more is needed to solve this issue please tell me, thanks!   Image of weird behaviour: FlipsMenu.java: Opens the menu by changing a "screen to open" variable that gets checked every tick. AHFlipsGui.java: draws the background image and specifies size of the gui. AHFlipsContainer.java: Where we assign the slots.   AHFlipsInventory.java: The actual inventory.  
    • Remove Create Steam and Rails And only post the mclo.gs link This is correct - for example, Forge alone loads 2 mods
    • Looks like an issue/conflict between createbigcannons and Immersive Portals Make a test without one of these mods
    • When I try to start minecraft with any version of apugli, it crashes with error code 1. I would like to be able to use apugli. I assume it is possible. Here is the log. [25Jul2024 01:13:40.857] [main/INFO] [cpw.mods.modlauncher.Launcher/MODLAUNCHER]: ModLauncher running: args [--username, Hulk_Lover_Plays, --version, 1.20.1-forge-47.2.0, --gameDir, /Users/********/Library/Application Support/minecraft, --assetsDir, /Users/********/Library/Application Support/minecraft/assets, --assetIndex, 5, --uuid, 66f9ccb4b165413793c5fe0231c6f69b, --accessToken, ❄❄❄❄❄❄❄❄, --clientId, Q0UwMThENjY0MTcwNDg1RjgyOUFDNEU1MjFBODRDOUE=, --xuid, 2535440348547496, --userType, msa, --versionType, release, --quickPlayPath, /Users/********/Library/Application Support/minecraft/quickPlay/java/1721884416999.json, --launchTarget, forgeclient, --fml.forgeVersion, 47.2.0, --fml.mcVersion, 1.20.1, --fml.forgeGroup, net.minecraftforge, --fml.mcpVersion, 20230612.114412] [25Jul2024 01:13:40.883] [main/INFO] [cpw.mods.modlauncher.Launcher/MODLAUNCHER]: ModLauncher 10.0.9+10.0.9+main.dcd20f30 starting: java version 17.0.8 by Microsoft; OS Mac OS X arch x86_64 version 14.5 [25Jul2024 01:13:41.291] [main/INFO] [net.minecraftforge.fml.loading.ImmediateWindowHandler/]: Loading ImmediateWindowProvider fmlearlywindow [25Jul2024 01:13:41.471] [main/INFO] [EARLYDISPLAY/]: Trying GL version 4.6 [25Jul2024 01:13:41.542] [main/INFO] [EARLYDISPLAY/]: Trying GL version 4.5 [25Jul2024 01:13:41.556] [main/INFO] [EARLYDISPLAY/]: Trying GL version 4.4 [25Jul2024 01:13:41.568] [main/INFO] [EARLYDISPLAY/]: Trying GL version 4.3 [25Jul2024 01:13:41.579] [main/INFO] [EARLYDISPLAY/]: Trying GL version 4.2 [25Jul2024 01:13:41.591] [main/INFO] [EARLYDISPLAY/]: Trying GL version 4.1 [25Jul2024 01:13:41.609] [main/INFO] [EARLYDISPLAY/]: Requested GL version 4.1 got version 4.1 [25Jul2024 01:13:41.737] [main/INFO] [optifine.OptiFineTransformationService/]: OptiFineTransformationService.onLoad [25Jul2024 01:13:41.740] [main/INFO] [optifine.OptiFineTransformationService/]: OptiFine ZIP file URL: union:/Users/********/Library/Application%20Support/minecraft/mods/OptiFine_1.20.1_HD_U_I6.jar%23161!/ [25Jul2024 01:13:41.750] [main/INFO] [optifine.OptiFineTransformationService/]: OptiFine ZIP file: /Users/********/Library/Application Support/minecraft/mods/OptiFine_1.20.1_HD_U_I6.jar [25Jul2024 01:13:41.753] [main/INFO] [optifine.OptiFineTransformer/]: Target.PRE_CLASS is available [25Jul2024 01:13:41.804] [pool-2-thread-1/INFO] [EARLYDISPLAY/]: GL info: Apple M1 GL version 4.1 Metal - 88.1, Apple [25Jul2024 01:13:41.853] [main/INFO] [mixin/]: SpongePowered MIXIN Subsystem Version=0.8.5 Source=union:/Users/********/Library/Application%20Support/minecraft/libraries/org/spongepowered/mixin/0.8.5/mixin-0.8.5.jar%2394!/ Service=ModLauncher Env=CLIENT [25Jul2024 01:13:41.880] [main/INFO] [optifine.OptiFineTransformationService/]: OptiFineTransformationService.initialize [25Jul2024 01:13:42.380] [main/WARN] [net.minecraftforge.fml.loading.moddiscovery.ModFileParser/LOADING]: Mod file /Users/********/Library/Application Support/minecraft/libraries/net/minecraftforge/fmlcore/1.20.1-47.2.0/fmlcore-1.20.1-47.2.0.jar is missing mods.toml file [25Jul2024 01:13:42.386] [main/WARN] [net.minecraftforge.fml.loading.moddiscovery.ModFileParser/LOADING]: Mod file /Users/********/Library/Application Support/minecraft/libraries/net/minecraftforge/javafmllanguage/1.20.1-47.2.0/javafmllanguage-1.20.1-47.2.0.jar is missing mods.toml file [25Jul2024 01:13:42.389] [main/WARN] [net.minecraftforge.fml.loading.moddiscovery.ModFileParser/LOADING]: Mod file /Users/********/Library/Application Support/minecraft/libraries/net/minecraftforge/lowcodelanguage/1.20.1-47.2.0/lowcodelanguage-1.20.1-47.2.0.jar is missing mods.toml file [25Jul2024 01:13:42.392] [main/WARN] [net.minecraftforge.fml.loading.moddiscovery.ModFileParser/LOADING]: Mod file /Users/********/Library/Application Support/minecraft/libraries/net/minecraftforge/mclanguage/1.20.1-47.2.0/mclanguage-1.20.1-47.2.0.jar is missing mods.toml file [25Jul2024 01:13:42.759] [main/WARN] [net.minecraftforge.jarjar.selection.JarSelector/]: Attempted to select two dependency jars from JarJar which have the same identification: Mod File: and Mod File: . Using Mod File: [25Jul2024 01:13:42.761] [main/INFO] [net.minecraftforge.fml.loading.moddiscovery.JarInJarDependencyLocator/]: Found 5 dependencies adding them to mods collection [25Jul2024 01:13:44.084] [main/INFO] [optifine.OptiFineTransformationService/]: OptiFineTransformationService.transformers [25Jul2024 01:13:44.100] [main/INFO] [optifine.OptiFineTransformer/]: Targets: 412 [25Jul2024 01:13:46.160] [main/INFO] [optifine.OptiFineTransformationService/]: additionalClassesLocator: [optifine., net.optifine.] [25Jul2024 01:13:46.675] [main/INFO] [mixin/]: Compatibility level set to JAVA_17 [25Jul2024 01:13:46.718] [main/INFO] [cpw.mods.modlauncher.LaunchServiceHandler/MODLAUNCHER]: Launching target 'forgeclient' with arguments [--version, 1.20.1-forge-47.2.0, --gameDir, /Users/********/Library/Application Support/minecraft, --assetsDir, /Users/********/Library/Application Support/minecraft/assets, --uuid, 66f9ccb4b165413793c5fe0231c6f69b, --username, Hulk_Lover_Plays, --assetIndex, 5, --accessToken, ❄❄❄❄❄❄❄❄, --clientId, Q0UwMThENjY0MTcwNDg1RjgyOUFDNEU1MjFBODRDOUE=, --xuid, 2535440348547496, --userType, msa, --versionType, release, --quickPlayPath, /Users/********/Library/Application Support/minecraft/quickPlay/java/1721884416999.json] [25Jul2024 01:13:51.055] [main/INFO] [MixinExtras|Service/]: Initializing MixinExtras via com.llamalad7.mixinextras.service.MixinExtrasServiceImpl(version=0.3.6). [25Jul2024 01:13:55.244] [main/FATAL] [mixin/]: Mixin apply failed apugli.forge.mixins.json:client.GameRendererMixin -> net.minecraft.client.renderer.GameRenderer: org.spongepowered.asm.mixin.injection.throwables.InvalidInjectionException Critical injection failure: @ModifyExpressionValue annotation on apugli$preventPickingOfPreventedEntities could not find any targets matching 'Lnet/minecraft/client/renderer/GameRenderer;m_234236_(Lnet/minecraft/world/entity/Entity;)Z' in net.minecraft.client.renderer.GameRenderer. Using refmap apugli.refmap.json [PREINJECT Applicator Phase -> apugli.forge.mixins.json:client.GameRendererMixin -> Prepare Injections -> -> modifyExpressionValue$zpb000$apugli$preventPickingOfPreventedEntities(ZLnet/minecraft/world/entity/Entity;)Z -> Parse] org.spongepowered.asm.mixin.injection.throwables.InvalidInjectionException: Critical injection failure: @ModifyExpressionValue annotation on apugli$preventPickingOfPreventedEntities could not find any targets matching 'Lnet/minecraft/client/renderer/GameRenderer;m_234236_(Lnet/minecraft/world/entity/Entity;)Z' in net.minecraft.client.renderer.GameRenderer. Using refmap apugli.refmap.json [PREINJECT Applicator Phase -> apugli.forge.mixins.json:client.GameRendererMixin -> Prepare Injections -> -> modifyExpressionValue$zpb000$apugli$preventPickingOfPreventedEntities(ZLnet/minecraft/world/entity/Entity;)Z -> Parse] at org.spongepowered.asm.mixin.injection.struct.InjectionInfo.validateTargets(InjectionInfo.java:656) ~[mixin-0.8.5.jar:0.8.5+Jenkins-b310.git-155314e6e91465dad727e621a569906a410cd6f4] at org.spongepowered.asm.mixin.injection.struct.InjectionInfo.findTargets(InjectionInfo.java:587) ~[mixin-0.8.5.jar:0.8.5+Jenkins-b310.git-155314e6e91465dad727e621a569906a410cd6f4] at org.spongepowered.asm.mixin.injection.struct.InjectionInfo.readAnnotation(InjectionInfo.java:330) ~[mixin-0.8.5.jar:0.8.5+Jenkins-b310.git-155314e6e91465dad727e621a569906a410cd6f4] at org.spongepowered.asm.mixin.injection.struct.InjectionInfo.<init>(InjectionInfo.java:316) ~[mixin-0.8.5.jar:0.8.5+Jenkins-b310.git-155314e6e91465dad727e621a569906a410cd6f4] at org.spongepowered.asm.mixin.injection.struct.InjectionInfo.<init>(InjectionInfo.java:308) ~[mixin-0.8.5.jar:0.8.5+Jenkins-b310.git-155314e6e91465dad727e621a569906a410cd6f4] at com.llamalad7.mixinextras.injector.MixinExtrasInjectionInfo.<init>(MixinExtrasInjectionInfo.java:10) ~[MixinExtras-0.3.6.jar%23188!/:?] at com.llamalad7.mixinextras.injector.ModifyExpressionValueInjectionInfo.<init>(ModifyExpressionValueInjectionInfo.java:15) ~[MixinExtras-0.3.6.jar%23188!/:?] at jdk.internal.reflect.GeneratedConstructorAccessor27.newInstance(Unknown Source) ~[?:?] at jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) ~[?:?] at java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:499) ~[?:?] at java.lang.reflect.Constructor.newInstance(Constructor.java:480) ~[?:?] at org.spongepowered.asm.mixin.injection.struct.InjectionInfo$InjectorEntry.create(InjectionInfo.java:149) ~[mixin-0.8.5.jar:0.8.5+Jenkins-b310.git-155314e6e91465dad727e621a569906a410cd6f4] at org.spongepowered.asm.mixin.injection.struct.InjectionInfo.parse(InjectionInfo.java:708) ~[mixin-0.8.5.jar:0.8.5+Jenkins-b310.git-155314e6e91465dad727e621a569906a410cd6f4] at org.spongepowered.asm.mixin.transformer.MixinTargetContext.prepareInjections(MixinTargetContext.java:1311) ~[mixin-0.8.5.jar:0.8.5+Jenkins-b310.git-155314e6e91465dad727e621a569906a410cd6f4] at org.spongepowered.asm.mixin.transformer.MixinApplicatorStandard.prepareInjections(MixinApplicatorStandard.java:1042) ~[mixin-0.8.5.jar:0.8.5+Jenkins-b310.git-155314e6e91465dad727e621a569906a410cd6f4] at org.spongepowered.asm.mixin.transformer.MixinApplicatorStandard.applyMixin(MixinApplicatorStandard.java:393) ~[mixin-0.8.5.jar:0.8.5+Jenkins-b310.git-155314e6e91465dad727e621a569906a410cd6f4] at org.spongepowered.asm.mixin.transformer.MixinApplicatorStandard.apply(MixinApplicatorStandard.java:325) ~[mixin-0.8.5.jar:0.8.5+Jenkins-b310.git-155314e6e91465dad727e621a569906a410cd6f4] at org.spongepowered.asm.mixin.transformer.TargetClassContext.apply(TargetClassContext.java:383) ~[mixin-0.8.5.jar:0.8.5+Jenkins-b310.git-155314e6e91465dad727e621a569906a410cd6f4] at org.spongepowered.asm.mixin.transformer.TargetClassContext.applyMixins(TargetClassContext.java:365) ~[mixin-0.8.5.jar:0.8.5+Jenkins-b310.git-155314e6e91465dad727e621a569906a410cd6f4] at org.spongepowered.asm.mixin.transformer.MixinProcessor.applyMixins(MixinProcessor.java:363) ~[mixin-0.8.5.jar:0.8.5+Jenkins-b310.git-155314e6e91465dad727e621a569906a410cd6f4] at org.spongepowered.asm.mixin.transformer.MixinTransformer.transformClass(MixinTransformer.java:250) ~[mixin-0.8.5.jar:0.8.5+Jenkins-b310.git-155314e6e91465dad727e621a569906a410cd6f4] at org.spongepowered.asm.service.modlauncher.MixinTransformationHandler.processClass(MixinTransformationHandler.java:131) ~[mixin-0.8.5.jar:0.8.5+Jenkins-b310.git-155314e6e91465dad727e621a569906a410cd6f4] at org.spongepowered.asm.launch.MixinLaunchPluginLegacy.processClass(MixinLaunchPluginLegacy.java:131) ~[mixin-0.8.5.jar:0.8.5+Jenkins-b310.git-155314e6e91465dad727e621a569906a410cd6f4] at cpw.mods.modlauncher.serviceapi.ILaunchPluginService.processClassWithFlags(ILaunchPluginService.java:156) ~[modlauncher-10.0.9.jar:10.0.9+10.0.9+main.dcd20f30] at cpw.mods.modlauncher.LaunchPluginHandler.offerClassNodeToPlugins(LaunchPluginHandler.java:88) ~[modlauncher-10.0.9.jar:?] at cpw.mods.modlauncher.ClassTransformer.transform(ClassTransformer.java:120) ~[modlauncher-10.0.9.jar:?] at cpw.mods.modlauncher.TransformingClassLoader.maybeTransformClassBytes(TransformingClassLoader.java:50) ~[modlauncher-10.0.9.jar:?] at cpw.mods.cl.ModuleClassLoader.readerToClass(ModuleClassLoader.java:113) ~[securejarhandler-2.1.10.jar:?] at cpw.mods.cl.ModuleClassLoader.lambda$findClass$15(ModuleClassLoader.java:219) ~[securejarhandler-2.1.10.jar:?] at cpw.mods.cl.ModuleClassLoader.loadFromModule(ModuleClassLoader.java:229) ~[securejarhandler-2.1.10.jar:?] at cpw.mods.cl.ModuleClassLoader.findClass(ModuleClassLoader.java:219) ~[securejarhandler-2.1.10.jar:?] at cpw.mods.cl.ModuleClassLoader.loadClass(ModuleClassLoader.java:135) ~[securejarhandler-2.1.10.jar:?] at java.lang.ClassLoader.loadClass(ClassLoader.java:525) ~[?:?] at java.lang.Class.getDeclaredFields0(Native Method) ~[?:?] at java.lang.Class.privateGetDeclaredFields(Class.java:3297) ~[?:?] at java.lang.Class.getDeclaredFields(Class.java:2371) ~[?:?] at net.optifine.reflect.FieldLocatorTypes.<init>(FieldLocatorTypes.java:25) ~[OptiFine_1.20.1_HD_U_I6.jar%23192!/:?] at net.optifine.reflect.Reflector.<clinit>(Reflector.java:550) ~[OptiFine_1.20.1_HD_U_I6.jar%23192!/:?] at net.minecraft.CrashReport.m_127526_(CrashReport.java:176) ~[client-1.20.1-20230612.114412-srg.jar%23171!/:?] at net.minecraft.CrashReport.m_127529_(CrashReport.java:346) ~[client-1.20.1-20230612.114412-srg.jar%23171!/:?] at net.minecraft.client.main.Main.main(Main.java:149) ~[1.20.1-forge-47.2.0.jar:?] at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:?] at jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77) ~[?:?] at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?] at java.lang.reflect.Method.invoke(Method.java:568) ~[?:?] at net.minecraftforge.fml.loading.targets.CommonLaunchHandler.runTarget(CommonLaunchHandler.java:111) ~[fmlloader-1.20.1-47.2.0.jar:?] at net.minecraftforge.fml.loading.targets.CommonLaunchHandler.clientService(CommonLaunchHandler.java:99) ~[fmlloader-1.20.1-47.2.0.jar:?] at net.minecraftforge.fml.loading.targets.CommonClientLaunchHandler.lambda$makeService$0(CommonClientLaunchHandler.java:25) ~[fmlloader-1.20.1-47.2.0.jar:?] at cpw.mods.modlauncher.LaunchServiceHandlerDecorator.launch(LaunchServiceHandlerDecorator.java:30) ~[modlauncher-10.0.9.jar:?] at cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:53) ~[modlauncher-10.0.9.jar:?] at cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:71) ~[modlauncher-10.0.9.jar:?] at cpw.mods.modlauncher.Launcher.run(Launcher.java:108) ~[modlauncher-10.0.9.jar:?] at cpw.mods.modlauncher.Launcher.main(Launcher.java:78) ~[modlauncher-10.0.9.jar:?] at cpw.mods.modlauncher.BootstrapLaunchConsumer.accept(BootstrapLaunchConsumer.java:26) ~[modlauncher-10.0.9.jar:?] at cpw.mods.modlauncher.BootstrapLaunchConsumer.accept(BootstrapLaunchConsumer.java:23) ~[modlauncher-10.0.9.jar:?] at cpw.mods.bootstraplauncher.BootstrapLauncher.main(BootstrapLauncher.java:141) ~[bootstraplauncher-1.1.2.jar:?]
  • Topics

×
×
  • Create New...

Important Information

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