Vai al contenuto
Il server del mese è
Visita la nostra nuova lista server!

Archiviato

Questa discussione è archiviata e chiusa a future risposte.

  • 0
SuperReAlex012

Problema Mob?

Domanda

salve ragazzi, sto creando un nuovo mob zombie, sapreste dirmi come , quando è mattina, prenda fuoco? a me rimane vivo

Condividi questo messaggio


Link di questo messaggio
Condividi su altri siti

3 risposte a questa domanda

Recommended Posts

salve ragazzi, sto creando un nuovo mob zombie, sapreste dirmi come , quando è mattina, prenda fuoco? a me rimane vivo

 

Bastava spulciare il codice degli zombie :)

 

[spoiler]

    public void onLivingUpdate()
    {
        if (this.worldObj.isDaytime() && !this.worldObj.isRemote && !this.isChild())
        {
            float f = this.getBrightness(1.0F);

            if (f > 0.5F && this.rand.nextFloat() * 30.0F < (f - 0.4F) * 2.0F && this.worldObj.canBlockSeeTheSky(MathHelper.floor_double(this.posX), MathHelper.floor_double(this.posY), MathHelper.floor_double(this.posZ)))
            {
                boolean flag = true;
                ItemStack itemstack = this.getCurrentItemOrArmor(4);

                if (itemstack != null)
                {
                    if (itemstack.isItemStackDamageable())
                    {
                        itemstack.setItemDamage(itemstack.getItemDamageForDisplay() + this.rand.nextInt(2));

                        if (itemstack.getItemDamageForDisplay() >= itemstack.getMaxDamage())
                        {
                            this.renderBrokenItemStack(itemstack);
                            this.setCurrentItemOrArmor(4, (ItemStack)null);
                        }
                    }

                    flag = false;
                }

                if (flag)
                {
                    this.setFire(8);
                }
            }
        }

        super.onLivingUpdate();
    }
 

[/spoiler]

Condividi questo messaggio


Link di questo messaggio
Condividi su altri siti

Bastava spulciare il codice degli zombie :)

 

[spoiler]

    public void onLivingUpdate()
    {
        if (this.worldObj.isDaytime() && !this.worldObj.isRemote && !this.isChild())
        {
            float f = this.getBrightness(1.0F);

            if (f > 0.5F && this.rand.nextFloat() * 30.0F < (f - 0.4F) * 2.0F && this.worldObj.canBlockSeeTheSky(MathHelper.floor_double(this.posX), MathHelper.floor_double(this.posY), MathHelper.floor_double(this.posZ)))
            {
                boolean flag = true;
                ItemStack itemstack = this.getCurrentItemOrArmor(4);

                if (itemstack != null)
                {
                    if (itemstack.isItemStackDamageable())
                    {
                        itemstack.setItemDamage(itemstack.getItemDamageForDisplay() + this.rand.nextInt(2));

                        if (itemstack.getItemDamageForDisplay() >= itemstack.getMaxDamage())
                        {
                            this.renderBrokenItemStack(itemstack);
                            this.setCurrentItemOrArmor(4, (ItemStack)null);
                        }
                    }

                    flag = false;
                }

                if (flag)
                {
                    this.setFire(8);
                }
            }
        }

        super.onLivingUpdate();
    }
 

[/spoiler]

grz :)

Condividi questo messaggio


Link di questo messaggio
Condividi su altri siti
Messaggio Automatico

Questa discussione è stata sposta da"[url='http://www.minecraftitalia.net/forum/index.php?showforum=10']Mods[/url]" a "[url='http://www.minecraftitalia.net/forum/index.php?showforum=187']Domande e Consigli[/url]".

Condividi questo messaggio


Link di questo messaggio
Condividi su altri siti

×
×
  • Crea Nuovo...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.