Register for your free account! | Forgot your password?

Go Back   elitepvpers > Other Online Games > Minecraft
You last visited: Today at 21:40

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



Minecraft neue Mobs einfügen fehlerhafte Gestalt..

Discussion on Minecraft neue Mobs einfügen fehlerhafte Gestalt.. within the Minecraft forum part of the Other Online Games category.

Reply
 
Old   #1
 
Endless.'s Avatar
 
elite*gold: 0
Join Date: Apr 2010
Posts: 2,047
Received Thanks: 744
Minecraft neue Mobs einfügen fehlerhafte Gestalt..

Guten Abend zusammen

Ich beschäftige mich gerade damit, ein Paar neue Tiere einzubauen..
Allerdings habe ich jetzt ein Frosch versucht.. indem ich die Daten vom "Slime"
also die "EntitySlime.java" kopiert habe, als "EntityFrog" umbenannt habe und dort ein Paar Dinge zu "Frog" umbenannt.. der Mob selber existiert ja.. aber
wenn ich mir den so angucke.. sieht das eher so aus.. als ob da so Einiges
schief gelaufen ist. Hier Screen:



Inhalt der EntityFrog.java

Code:
package net.minecraft.src;

public class EntityFrog extends EntityLiving implements IMob
{
    private static final float[] field_100000_e = new float[] {1.0F, 0.75F, 0.5F, 0.25F, 0.0F, 0.25F, 0.5F, 0.75F};
    public float field_70813_a;
    public float field_70811_b;
    public float field_70812_c;

    /** the time between each jump of the slime */
    private int slimeJumpDelay = 0;

    public EntityFrog(World par1World)
    {
        super(par1World);
        this.texture = "/mob/slime.png";
        int var2 = 1 << this.rand.nextInt(3);
        this.yOffset = 0.0F;
        this.slimeJumpDelay = this.rand.nextInt(20) + 10;
        this.setSlimeSize(var2);
    }

    protected void entityInit()
    {
        super.entityInit();
        this.dataWatcher.addObject(16, new Byte((byte)1));
    }

    protected void setSlimeSize(int par1)
    {
        this.dataWatcher.updateObject(16, new Byte((byte)par1));
        this.setSize(0.6F * (float)par1, 0.6F * (float)par1);
        this.setPosition(this.posX, this.posY, this.posZ);
        this.setEntityHealth(this.getMaxHealth());
        this.experienceValue = par1;
    }

    public int getMaxHealth()
    {
        int var1 = this.getSlimeSize();
        return var1 * var1;
    }

    /**
     * Returns the size of the slime.
     */
    public int getSlimeSize()
    {
        return this.dataWatcher.getWatchableObjectByte(16);
    }

    /**
     * (abstract) Protected helper method to write subclass entity data to NBT.
     */
    public void writeEntityToNBT(NBTTagCompound par1NBTTagCompound)
    {
        super.writeEntityToNBT(par1NBTTagCompound);
        par1NBTTagCompound.setInteger("Size", this.getSlimeSize() - 1);
    }

    /**
     * (abstract) Protected helper method to read subclass entity data from NBT.
     */
    public void readEntityFromNBT(NBTTagCompound par1NBTTagCompound)
    {
        super.readEntityFromNBT(par1NBTTagCompound);
        this.setSlimeSize(par1NBTTagCompound.getInteger("Size") + 1);
    }

    /**
     * Returns the name of a particle effect that may be randomly created by EntitySlime.onUpdate()
     */
    protected String getSlimeParticle()
    {
        return "slime";
    }

    /**
     * Returns the name of the sound played when the slime jumps.
     */
    protected String getJumpSound()
    {
        return "mob.slime." + (this.getSlimeSize() > 1 ? "big" : "small");
    }

    /**
     * Called to update the entity's position/logic.
     */
    public void onUpdate()
    {
        if (!this.worldObj.isRemote && this.worldObj.difficultySetting == 0 && this.getSlimeSize() > 0)
        {
            this.isDead = true;
        }

        this.field_70811_b += (this.field_70813_a - this.field_70811_b) * 0.5F;
        this.field_70812_c = this.field_70811_b;
        boolean var1 = this.onGround;
        super.onUpdate();
        int var2;

        if (this.onGround && !var1)
        {
            var2 = this.getSlimeSize();

            for (int var3 = 0; var3 < var2 * 8; ++var3)
            {
                float var4 = this.rand.nextFloat() * (float)Math.PI * 2.0F;
                float var5 = this.rand.nextFloat() * 0.5F + 0.5F;
                float var6 = MathHelper.sin(var4) * (float)var2 * 0.5F * var5;
                float var7 = MathHelper.cos(var4) * (float)var2 * 0.5F * var5;
                this.worldObj.spawnParticle(this.getSlimeParticle(), this.posX + (double)var6, this.boundingBox.minY, this.posZ + (double)var7, 0.0D, 0.0D, 0.0D);
            }

            if (this.makesSoundOnLand())
            {
                this.playSound(this.getJumpSound(), this.getSoundVolume(), ((this.rand.nextFloat() - this.rand.nextFloat()) * 0.2F + 1.0F) / 0.8F);
            }

            this.field_70813_a = -0.5F;
        }
        else if (!this.onGround && var1)
        {
            this.field_70813_a = 1.0F;
        }

        this.func_70808_l();

        if (this.worldObj.isRemote)
        {
            var2 = this.getSlimeSize();
            this.setSize(0.6F * (float)var2, 0.6F * (float)var2);
        }
    }

    protected void updateEntityActionState()
    {
        this.despawnEntity();
        EntityPlayer var1 = this.worldObj.getClosestVulnerablePlayerToEntity(this, 16.0D);

        if (var1 != null)
        {
            this.faceEntity(var1, 10.0F, 20.0F);
        }

        if (this.onGround && this.slimeJumpDelay-- <= 0)
        {
            this.slimeJumpDelay = this.getJumpDelay();

            if (var1 != null)
            {
                this.slimeJumpDelay /= 3;
            }

            this.isJumping = true;

            if (this.makesSoundOnJump())
            {
                this.playSound(this.getJumpSound(), this.getSoundVolume(), ((this.rand.nextFloat() - this.rand.nextFloat()) * 0.2F + 1.0F) * 0.8F);
            }

            this.moveStrafing = 1.0F - this.rand.nextFloat() * 2.0F;
            this.moveForward = (float)(1 * this.getSlimeSize());
        }
        else
        {
            this.isJumping = false;

            if (this.onGround)
            {
                this.moveStrafing = this.moveForward = 0.0F;
            }
        }
    }

    protected void func_70808_l()
    {
        this.field_70813_a *= 0.6F;
    }

    /**
     * Gets the amount of time the slime needs to wait between jumps.
     */
    protected int getJumpDelay()
    {
        return this.rand.nextInt(20) + 10;
    }

    protected EntityFrog createInstance()
    {
        return new EntityFrog(this.worldObj);
    }

    /**
     * Will get destroyed next tick.
     */
    public void setDead()
    {
        int var1 = this.getSlimeSize();

        if (!this.worldObj.isRemote && var1 > 1 && this.getHealth() <= 0)
        {
            int var2 = 2 + this.rand.nextInt(3);

            for (int var3 = 0; var3 < var2; ++var3)
            {
                float var4 = ((float)(var3 % 2) - 0.5F) * (float)var1 / 4.0F;
                float var5 = ((float)(var3 / 2) - 0.5F) * (float)var1 / 4.0F;
                EntityFrog var6 = this.createInstance();
                var6.setSlimeSize(var1 / 2);
                var6.setLocationAndAngles(this.posX + (double)var4, this.posY + 0.5D, this.posZ + (double)var5, this.rand.nextFloat() * 360.0F, 0.0F);
                this.worldObj.spawnEntityInWorld(var6);
            }
        }

        super.setDead();
    }

    /**
     * Called by a player entity when they collide with an entity
     */
    public void onCollideWithPlayer(EntityPlayer par1EntityPlayer)
    {
        if (this.canDamagePlayer())
        {
            int var2 = this.getSlimeSize();

            if (this.canEntityBeSeen(par1EntityPlayer) && this.getDistanceSqToEntity(par1EntityPlayer) < 0.6D * (double)var2 * 0.6D * (double)var2 && par1EntityPlayer.attackEntityFrom(DamageSource.causeMobDamage(this), this.getAttackStrength()))
            {
                this.playSound("mob.attack", 1.0F, (this.rand.nextFloat() - this.rand.nextFloat()) * 0.2F + 1.0F);
            }
        }
    }

    /**
     * Indicates weather the slime is able to damage the player (based upon the slime's size)
     */
    protected boolean canDamagePlayer()
    {
        return this.getSlimeSize() > 1;
    }

    /**
     * Gets the amount of damage dealt to the player when "attacked" by the slime.
     */
    protected int getAttackStrength()
    {
        return this.getSlimeSize();
    }

    /**
     * Returns the sound this mob makes when it is hurt.
     */
    protected String getHurtSound()
    {
        return "mob.slime." + (this.getSlimeSize() > 1 ? "big" : "small");
    }

    /**
     * Returns the sound this mob makes on death.
     */
    protected String getDeathSound()
    {
        return "mob.slime." + (this.getSlimeSize() > 1 ? "big" : "small");
    }

    /**
     * Returns the item ID for the item the mob drops on death.
     */
    protected int getDropItemId()
    {
        return this.getSlimeSize() == 1 ? Item.slimeBall.itemID : 0;
    }

    /**
     * Checks if the entity's current position is a valid location to spawn this entity.
     */
    public boolean getCanSpawnHere()
    {
        Chunk var1 = this.worldObj.getChunkFromBlockCoords(MathHelper.floor_double(this.posX), MathHelper.floor_double(this.posZ));

        if (this.worldObj.getWorldInfo().getTerrainType() == WorldType.FLAT && this.rand.nextInt(4) != 1)
        {
            return false;
        }
        else
        {
            if (this.getSlimeSize() == 1 || this.worldObj.difficultySetting > 0)
            {
                BiomeGenBase var2 = this.worldObj.getBiomeGenForCoords(MathHelper.floor_double(this.posX), MathHelper.floor_double(this.posZ));

                if (var2 == BiomeGenBase.swampland && this.posY > 50.0D && this.posY < 70.0D && this.rand.nextFloat() < 0.5F && this.rand.nextFloat() < field_100000_e[this.worldObj.getMoonPhase()] && this.worldObj.getBlockLightValue(MathHelper.floor_double(this.posX), MathHelper.floor_double(this.posY), MathHelper.floor_double(this.posZ)) <= this.rand.nextInt(8))
                {
                    return super.getCanSpawnHere();
                }

                if (this.rand.nextInt(10) == 0 && var1.getRandomWithSeed(987234911L).nextInt(10) == 0 && this.posY < 40.0D)
                {
                    return super.getCanSpawnHere();
                }
            }

            return false;
        }
    }

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

    /**
     * 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 0;
    }

    /**
     * Returns true if the slime makes a sound when it jumps (based upon the slime's size)
     */
    protected boolean makesSoundOnJump()
    {
        return this.getSlimeSize() > 0;
    }

    /**
     * Returns true if the slime makes a sound when it lands after a jump (based upon the slime's size)
     */
    protected boolean makesSoundOnLand()
    {
        return this.getSlimeSize() > 2;
    }
}
Ich weiss nicht was ich falsch gemacht habe.. normal müsste
jetzt ein Slime ohne Textur rumhüpfen.. oder zumindest der gleiche, da ich dem die gleiche Textur gab..


Und ich suche nach einer Lösung "OHNE" Forge.. sondern möchte ganz normal wie ich die Blöcke und Items erstellt habe.. auch die Mobs so einbauen

€: Wie stell ich ein, das der auf "Peaceful" spawnt?
Könnt ihr mir helfen?


Gruß, Endless
Endless. is offline  
Old 04/28/2013, 20:57   #2

 
Dingtax's Avatar
 
elite*gold: 340
The Black Market: 144/0/0
Join Date: Apr 2011
Posts: 1,577
Received Thanks: 341
Also, der "Frosch" ist doch genial
Dingtax is offline  
Old 04/29/2013, 11:12   #3
 
elite*gold: 0
Join Date: Mar 2013
Posts: 297
Received Thanks: 7
Versuch doch mal in Cinema 3d erst einmal die Form vom Frosch danach sollte es eigentlich klappen es gibt auch gute Tutorials in Youtube dazu wie man eigene Mobs erstellt einfach mal Googlen!
SBotDE is offline  
Reply


Similar Threads Similar Threads
[Hilfe]Neue Mobs einfügen BUG
03/18/2013 - Metin2 Private Server - 4 Replies
Hallöchen, ich habe ein kleines Problem. Ich habe heute mal versuch einen neuen Mob einzufügen und weiß auch "eigentlich" wie es funktioniert. Habe die Modelle in die Monster und Monster2 gepackt, die npclist inner Root überarbeitet und die Mob_proto auch. Die vnums stimmen Clientside und Serverside überein und die Pfade in der MSM-Datei stimmt auch. Habe auch nochmal die Monster und Monster2 überprüft und es wurde alles erfolgreich gepackt. Jetzt verstehe ich aber nicht, warum ich Ingame,...
Neue mobs einfügen?
06/06/2012 - Metin2 Private Server - 7 Replies
hallo und zwar ich habe da mal eine frage und zwar wie kann ich diese >>KLICK<< mobs impementieren? danke schon mal für antworten LG Schaggi
Problem neue mobs einfügen
07/27/2011 - Metin2 Private Server - 19 Replies
Hi Leute Ich hab ein kleines Problem mit einpaar neuen mobs. Ich wollte die in mein Server einbaun Also ich hab in Navicat bei der mob_proto Tabelle neue value für die mobs eingetragen ( hab einfach von ein anderen mob alles abgeschrieben) Natürlcih gibt es die Value noch nicht^^ Danach hab ich die monster2 im pack Ordner entpackt und die neuen monster Ordner im Ordner monster2 eingefügt. Dann hab ich die Pack xml angepasst und wieder die monster2 gepackt. Dann hab ich noch in der...
Mobs in die neue Map einfügen!
05/07/2011 - Metin2 Private Server - 4 Replies
closed#



All times are GMT +1. The time now is 21:41.


Powered by vBulletin®
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2026 elitepvpers All Rights Reserved.