MCreator 1.5.6(Minecraft 1.7.10) Need a fix for hostile mobs.

Started by Darealslenderman on Fri, 07/24/2015 - 05:30
Last seen on 05:04, 27. Mar 2017
Joined Aug 2014
User points:

Statistics:

  • Comments:
  • Forum topics:
  • Modifications:
  • Wiki pages:
MCreator 1.5.6(Minecraft 1.7.10) Need a fix for hostile mobs.
Fri, 07/24/2015 - 05:30

I started making new mobs, that use vanilla AI, was creating magical versions of mobs, but they seem to not spawn, not matter what the option was. 

So to make sure im not screwing up with the GUI, i set the zombie as a monster, made the egg colors, imported the texture, then next step, named it, set the health, XP, damage, sounds drops etc. Then i didnt need to add any events, so then comes the AI, i put has AI, then i set it to a zombie, then contiuned on. Kept 20 as the problility 3 as min spawn and 30 as maxiumn, didnt a spefic biome, nor the dungone option, let it complie, and it seems. Worked, launched the client on mcreator, then that worked, so i spawned into a world. And waited several ingame days, went through entire nights ingame, None of them spawned. so i tried different settings but none seemed to work. Unless it was an animal but did not need to be passive. Any ideas how to fix the code so it works?

I dont want to go to Mcreator 1.5.7 because its mincraft 1.8 just to fix this mob code. 

 

Heres the source code mcreator generated from a test mob i made

package mod.mcreator;//based on master condiguration

import cpw.mods.fml.client.*;
import cpw.mods.fml.client.registry.*;
import cpw.mods.fml.common.*;
import cpw.mods.fml.common.asm.*;
import cpw.mods.fml.common.asm.transformers.*;
import cpw.mods.fml.common.discovery.*;
import cpw.mods.fml.common.discovery.asm.*;
import cpw.mods.fml.common.event.*;
import cpw.mods.fml.common.functions.*;
import cpw.mods.fml.common.network.*;
import cpw.mods.fml.common.registry.*;
import cpw.mods.fml.common.toposort.*;
import cpw.mods.fml.common.versioning.*;
import cpw.mods.fml.relauncher.*;
import cpw.mods.fml.server.*;
import net.minecraft.block.*;
import net.minecraft.block.material.*;
import net.minecraft.client.*;
import net.minecraft.client.audio.*;
import net.minecraft.client.entity.*;
import net.minecraft.client.gui.*;
import net.minecraft.client.gui.achievement.*;
import net.minecraft.client.gui.inventory.*;
import net.minecraft.client.model.*;
import net.minecraft.client.multiplayer.*;
import net.minecraft.client.particle.*;
import net.minecraft.client.renderer.*;
import net.minecraft.client.renderer.culling.*;
import net.minecraft.client.renderer.entity.*;
import net.minecraft.client.renderer.tileentity.*;
import net.minecraft.client.settings.*;
import net.minecraft.command.*;
import net.minecraft.crash.*;
import net.minecraft.creativetab.*;
import net.minecraft.dispenser.*;
import net.minecraft.enchantment.*;
import net.minecraft.entity.*;
import net.minecraft.entity.ai.*;
import net.minecraft.entity.boss.*;
import net.minecraft.entity.effect.*;
import net.minecraft.entity.item.*;
import net.minecraft.entity.monster.*;
import net.minecraft.entity.passive.*;
import net.minecraft.entity.player.*;
import net.minecraft.entity.projectile.*;
import net.minecraft.inventory.*;
import net.minecraft.item.*;
import net.minecraft.item.crafting.*;
import net.minecraft.nbt.*;
import net.minecraft.network.*;
import net.minecraft.network.rcon.*;
import net.minecraft.pathfinding.*;
import net.minecraft.potion.*;
import net.minecraft.profiler.*;
import net.minecraft.server.*;
import net.minecraft.server.dedicated.*;
import net.minecraft.server.gui.*;
import net.minecraft.server.integrated.*;
import net.minecraft.server.management.*;
import net.minecraft.src.*;
import net.minecraft.stats.*;
import net.minecraft.tileentity.*;
import net.minecraft.util.*;
import net.minecraft.village.*;
import net.minecraft.world.*;
import net.minecraft.world.biome.*;
import net.minecraft.world.chunk.*;
import net.minecraft.world.chunk.storage.*;
import net.minecraft.world.demo.*;
import net.minecraft.world.gen.*;
import net.minecraft.world.gen.feature.*;
import net.minecraft.world.gen.layer.*;
import net.minecraft.world.gen.structure.*;
import net.minecraft.world.storage.*;
import net.minecraftforge.classloading.*;
import net.minecraftforge.client.*;
import net.minecraftforge.client.event.*;
import net.minecraftforge.client.event.sound.*;
import net.minecraftforge.common.*;
import net.minecraftforge.event.*;
import net.minecraftforge.event.entity.*;
import net.minecraftforge.event.entity.item.*;
import net.minecraftforge.event.entity.living.*;
import net.minecraftforge.event.entity.minecart.*;
import net.minecraftforge.event.entity.player.*;
import net.minecraftforge.event.terraingen.*;
import net.minecraftforge.event.world.*;
import net.minecraftforge.oredict.*;
import net.minecraftforge.transformers.*;
import net.minecraft.init.*;
import java.util.*;

@SuppressWarnings("unchecked")
public class mcreator_testMob {

    public static int mobid = 0;
    public Object instance;

    public void load(){}

    public void generateNether(World world, Random random, int chunkX, int chunkZ){}
    public void generateSurface(World world, Random random, int chunkX, int chunkZ){}
    public int addFuel(ItemStack fuel){
        return 0;
    }
    @SideOnly(Side.CLIENT)
    public void registerRenderers(){
        RenderingRegistry.registerEntityRenderingHandler(mcreator_testMob.EntitytestMob.class, new RenderBiped(new ModelBiped(), 0){protected ResourceLocation getEntityTexture(Entity par1Entity){return new ResourceLocation("zombie.png");}});
    }
    public void serverLoad(FMLServerStartingEvent event){}
    public void preInit(FMLPreInitializationEvent event){
        int entityID = EntityRegistry.findGlobalUniqueEntityId();
        mobid = entityID;
        EntityRegistry.registerGlobalEntityID(mcreator_testMob.EntitytestMob.class, "testMob", entityID);
        EntityRegistry.registerModEntity(mcreator_testMob.EntitytestMob.class, "testMob", entityID, instance, 64, 1, true);
        EntityList.entityEggs.put(Integer.valueOf(entityID), new EntityList.EntityEggInfo(entityID, (51 << 16) + (204 << 8) + 0, (0 << 16) + (0 << 8) + 0));
        EntityRegistry.addSpawn(mcreator_testMob.EntitytestMob.class, 20, 3, 30, EnumCreatureType.monster , new BiomeGenBase[]{BiomeGenBase.ocean, BiomeGenBase.plains, BiomeGenBase.desert, BiomeGenBase.extremeHills, BiomeGenBase.forest, BiomeGenBase.taiga, BiomeGenBase.swampland, BiomeGenBase.river, BiomeGenBase.frozenOcean, BiomeGenBase.frozenRiver, BiomeGenBase.icePlains, BiomeGenBase.iceMountains, BiomeGenBase.mushroomIsland, BiomeGenBase.mushroomIslandShore, BiomeGenBase.beach, BiomeGenBase.desertHills, BiomeGenBase.forestHills, BiomeGenBase.taigaHills, BiomeGenBase.extremeHillsEdge, BiomeGenBase.jungle, BiomeGenBase.jungleHills, BiomeGenBase.jungleEdge, BiomeGenBase.deepOcean, BiomeGenBase.stoneBeach, BiomeGenBase.coldBeach, BiomeGenBase.birchForest, BiomeGenBase.birchForestHills, BiomeGenBase.roofedForest, BiomeGenBase.coldTaiga, BiomeGenBase.coldTaigaHills, BiomeGenBase.megaTaiga, BiomeGenBase.megaTaigaHills, BiomeGenBase.extremeHillsPlus, BiomeGenBase.savanna, BiomeGenBase.savannaPlateau, BiomeGenBase.mesa, BiomeGenBase.mesaPlateau_F, BiomeGenBase.mesaPlateau});

        
    }

    /*public Entity spawnEntity(int var1, World var2, double var3, double var5, double var7)
    {
        if(var1==mobid)
                return new mcreator_testMob.EntitytestMob(var2);
        else
                return null;
    }*/


   public static class EntitytestMob extends EntityZombie 
    {
        World world = null;
        public EntitytestMob(World var1)
        {
            super(var1);
            world = var1;
            experienceValue = 10;
            this.isImmuneToFire = true;
            addRandomArmor();
            
        }

        

        

        
protected void addRandomArmor(){

this.setCurrentItemOrArmor(0, new ItemStack(Items.iron_sword));
}

protected void dropRareDrop(int par1){
this.dropItem(Items.experience_bottle, 1);
}


        public boolean isAIEnabled()
        {
               return true;
        }

        /**
         * Drop 0-2 items of this living's type
         */
        protected void dropFewItems(boolean var1, int var2)
        {
            this.entityDropItem(new ItemStack(Items.rotten_flesh), 0.0F);
        }

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

        public void onStruckByLightning(EntityLightningBolt entityLightningBolt){
            int i = (int)this.posX;
            int j = (int)this.posY;
            int k = (int)this.posZ;
            Entity entity = this;
            
        }

        protected void fall(float l){
            int i = (int)this.posX;
            int j = (int)this.posY;
            int k = (int)this.posZ;
            super.fall(l);
            Entity entity = this;
            
        }

        public void onCriticalHit(Entity entity) {
            int i = (int)this.posX;
            int j = (int)this.posY;
            int k = (int)this.posZ;
            
        }

        public void onKillEntity(EntityLiving entityLiving){
            int i = (int)this.posX;
            int j = (int)this.posY;
            int k = (int)this.posZ;
            Entity entity = this;
            
        }

        public boolean interact(EntityPlayer entity){
            int i = (int)this.posX;
            int j = (int)this.posY;
            int k = (int)this.posZ;
            
            return true;
        }

        public String getEntityName(){
            return "testMob";
        }

    }

    

}