Problème pour mob

Zoctos

Jeune Youtubeur
30 Mars 2011
288
0
11
29
Bonjour,
voilà mon problème. J'ai créer un mob sauf que je veux que ce mob attaque deux mobs. Je sais quel code entré pour que ce mob attaque un mob mais pour deux je n'y arrive pas.
Donc si quelqu'un sait comment je dois organiser mon code j'en serais reconnaissant.
Merci d'avance.
 
Pardon pour le double post mais bon.
J'ai réussi à recompile et à lancer le jeu sans problème. Mais le mob a un problème.
Sauf que lorsqu'il spawn il s'inflige des dégats à lui même et de plus il ne bouge pas. Voici le code du mob.
Code:
package net.minecraft.src;
import java.util.*;
import net.minecraft.client.Minecraft;

public class EntityGanondorf extends EntityCreature
{

    public EntityGanondorf(World world)
    {
        super(world);
        texture = "/mod_Zelda_mob/Ganondorf.png";
        attackStrength = 10;
        health = 70;
    }

    public ItemStack getHeldItem()
    {
        return new ItemStack(net.minecraft.src.mod_Zelda.EpeeDeLumiere);
    }
    
    protected int getDropItemId()
    {
        return mod_Zelda.GanondorfRecord.shiftedIndex;
    }
    
    protected Entity findPlayerToAttack()
    {
        double d = -1D;
        EntityLiving entityliving = null;
        for(int i = 0; i < worldObj.loadedEntityList.size(); i++)
        {
            Entity entity = (Entity)worldObj.loadedEntityList.get(i);
            if(!(entity instanceof EntityLiving) || (entity instanceof EntityCreature) && !(entity instanceof EntityGanondorf))
            {
                continue;
            }
            double d1 = entity.getDistance(posX, posY, posZ);
            if(d1 < 16D && (d == -1D || d1 < d) && ((EntityLiving)entity).canEntityBeSeen(this))
            {
                d = d1;
                entityliving = (EntityLiving)entity;
            }
        }

        return entityliving;
    }
    
    protected void attackEntity(Entity entity, float f)
    {
        if(attackTime <= 0 && f < 2.0F && entity.boundingBox.maxY > boundingBox.minY && entity.boundingBox.minY < boundingBox.maxY)
        {
            attackTime = 20;
            entity.attackEntityFrom(this, attackStrength);
        }
    }

    protected String getHurtSound()
    {
        return "mob_zelda.GanondorfHurt";
    }

    protected String getDeathSound()
    {
        return "mob_zelda.GanondorfDeath";
    }

    protected String getLivingSound()
    {
        return "mob_zelda.Ganondorf";
    }

    public int getMaxSpawnedInChunk()
    {
        return 1;
    }
    protected int attackStrength;
}
Merci d'avance.