Vswe's Summer Courses | You're not logged in. Sign up or log in | Server time: | Donate
One can now see other persons' badge hunts. Simply head over to their profiles to access them.

Go back to course page

The anatomy of a Minecraft model

How to work with and create models for Minecraft

Model doesn't spawn

  • 2014-03-02 23:38:32
    I'm stuck at lectures 1 - Models and Textures
    When I try to spawn my entity it's not appearing. I don't get any errors, just want show up.

    It might be a little syntax error some where or a tiny bit of code missing. I cant figure it out.

    Here is the classes;

    EntityDroid:
    package UU.Model;

    import net.minecraft.entity.Entity;
    import net.minecraft.nbt.NBTTagCompound;
    import net.minecraft.world.World;

        public class EntityDroid extends Entity
        {
            private double startY;
            private double targetY;
            
            public EntityDroid(World world)
            {
                super (world);
            }

        public EntityDroid(World world, double x, double y, double z)
        {
            this(world);
            
            posX = x;
            startY = posY = y;
            posZ = z;
            
        }
        
        @Override
        public void onUpdate() {
            super.onUpdate();
        
            if (!worldObj.isRemote){
                if (targetY == 0 || Math.abs(posY - targetY) < 0.25)
                    {
                            targetY = startY + worldObj.rand.nextDouble() * 5;
                    }
                
                if (posY < targetY)
                {
                    motionY = 0.05;
                }else{
                    motionY = -0.05;
                }
            }    
                setPosition(posX + motionX, posY + motionY, posZ + motionZ);
        }

        @Override
        protected void entityInit()
        {
        
        }

        @Override
        protected void readEntityFromNBT(NBTTagCompound nbttagcompound)
        {
            startY = nbttagcompound.getShort("Start");
            startY = nbttagcompound.getShort("Target");
        }

        @Override
        protected void writeEntityToNBT(NBTTagCompound nbttagcompound)
        {
            nbttagcompound.setShort("Start",(short)startY);
            nbttagcompound.setShort("Target",(short)targetY);
        }

    }

    Entities:

    package UU.Model;

    import cpw.mods.fml.common.registry.EntityRegistry;
    import UU.Technical.Main.UsefulUtilities;

    public class Entities
    {
        public static void init()
        {
            EntityRegistry.registerModEntity(EntityDroid.class, "EntityDroid", 2, UsefulUtilities.instance, 80, 3, true);
        }
        

    }

    RenderDroid:

    package UU.Model;

    import net.minecraft.client.renderer.entity.Render;
    import net.minecraft.entity.Entity;
    import net.minecraft.util.ResourceLocation;

    import org.lwjgl.opengl.GL11;


    public class RenderDroid extends Render
    {
        private ModelDroid model;
        
        public RenderDroid()
        {
            model = new ModelDroid();
            shadowSize = 0.5F;
        }
        
        private static final ResourceLocation texture = new ResourceLocation("exampel", "textures/models/droid.png");
        
        public void renderDroid(EntityDroid droid, double x, double y, double z,
                float yaw, float partialTickTime)
        {
            GL11.glPushMatrix();
            GL11.glTranslatef((float) x,(float) y,(float) z);
            GL11.glScalef(-1F, -1F, 1F);
            
            bindEntityTexture(droid);
            
            model.render(droid, 0F, 0F, 0F, 0F, 0F, 0.0625F);
            
            GL11.glPopMatrix();
        }
        
        @Override
        public void doRender(Entity entity, double x, double y, double z,
                float yaw, float partialTickTime)
        {
            renderDroid((EntityDroid) entity, x, y, z, yaw, partialTickTime);
        }

        @Override
        protected ResourceLocation getEntityTexture(Entity entity)
        {
            return texture;
        }
        
    }

    ItemDroid:

    package UU.Model;

    import net.minecraft.client.renderer.texture.IconRegister;
    import net.minecraft.client.settings.GameSettings;
    import net.minecraft.entity.player.EntityPlayer;
    import net.minecraft.item.Item;
    import net.minecraft.item.ItemStack;
    import net.minecraft.world.GameRules;
    import net.minecraft.world.World;
    import UU.Items.TechnicalClass.ItemInfo;
    import UU.Technical.CreativeTab.UUCreativeTabs;
    import cpw.mods.fml.relauncher.Side;
    import cpw.mods.fml.relauncher.SideOnly;

        public class ItemDroid extends Item
        {
            public ItemDroid (int id)
            {
                super(id);
                setCreativeTab(UUCreativeTabs.UUItemsTab);
                setUnlocalizedName(ItemInfo.DroidUnlocalizedName);
            }
            
            @SideOnly(Side.CLIENT)
            public void registerIcons(IconRegister register)
            {
                itemIcon = register.registerIcon(ItemInfo.Texture_Loacation + ":" + ItemInfo.DroidTexture);
            }
            
            @Override
            public boolean onItemUseFirst(ItemStack stack, EntityPlayer player,
                    World world, int x, int y, int z,
                    int side, float hitX, float hitY, float hitZ)
            {
                if (!world.isRemote)
                {
                    world.spawnEntityInWorld(new EntityDroid(world, x + 0.5, y + 0.5, z + 0.5));
                    stack.stackSize--;
                    
                    return true;
                }else{
                    return false;
                }
            }
        }
  • 2014-03-03 11:04:38
    Are you registering the renderer, in the client proxy?
  • 2014-03-03 13:21:45
    Yes, the client proxy looks like this:

    package UU.Technical.Proxies;

    import UU.Model.EntityDroid;
    import UU.Model.RenderDroid;
    import cpw.mods.fml.client.registry.RenderingRegistry;

    public class ClientProxy extends CommonProxy
    {
        @Override
        public void initSounds()
        {
                //Sounds
        }

        @Override
        public void initRenders()
        {
                RenderingRegistry.registerEntityRenderingHandler(EntityDroid.class, new RenderDroid());
        }

    }


  • 2014-03-03 15:27:15
    I would recommend putting printLns in the entity and rendering , to check to see if the entity is created and to see if the entity is being rendered.

    Also are you calling the initRendering() in your mod base class?
  • 2014-03-03 18:30:48
    Also use the F3 in game debug screen to see if the entity is actually there and it is not rendered, or if it is never spawned
  • 2014-03-05 16:18:30
    I tried debugging this error a long while now, just going to clean up the workspace and try again. Thanks for the help anyway!
  • 2017-08-12 02:23:45
    301 Moved Permanently
    <a href=https://www.viagrapascherfr.com/>Click here>>></a>
  • 2017-10-02 23:52:26
    Writing doctoral dissertation is a prerequisite before a PhD degree conferred to you. It usually entails conducting some form of research. Dissertation writing is therefore not among the simplest form of writing you will come across. Dissertation writing process will normally begin by selecting of a topic or a concept. The topic should be on a relevant field and that which would lead to development of new knowledge in the field. While selecting a topic for dissertation writing, ensures that your topic is simple, realistic and attainable. After you have decided on a topic, you need to embark on writing a dissertation proposal. A dissertation proposal is a detailed work plan that provides specific details on how your dissertation project will be conducted. The proposal should contain; an introduction of the topic, the problem statement of your dissertation, objectives, research questions and hypothesis of your study and research methods you plan on using. A proposal in dissertation writing should also contain a literature review. A literature review is a detailed analysis of what other authors have said about your topic of study. The dissertation proposal should also include a work schedule and a budget plan for your dissertation project. After writing your proposal the next step is the collection and analysis of data. There are many approaches for collecting and analyzing data and the choice of these will dependent on the study. Then next is the actual dissertation writing. Dissertation papers should contain all those details included in the proposals. It should also encompass chapters that present the results and finding of the study. Dissertation writing should follow specific structure and style of formatting. This again will vary depending on your study type, institution or field of study. This process of dissertation writing consumes a lot of time and requires a lot of expertise and experience. These sometimes present a challenge to many students when it comes to dissertation writing. We are now providing dissertation writing services. We are offering dissertation papers for a variety of academic fields including; history, sciences, business, psychology and literature among many others. We have highly experienced writers who are also experts in dissertation writing. These dissertation writers are all PhD graduates who have years of practice in writing and have never disappointed when it comes to writing dissertation papers. Our writers will ensure that all the standards for your dissertation writing are adhered to. Though some standard requirement will vary from one dissertation papers to the other, there are some dissertation writing standard requirements that apply to all dissertation papers. One of them is the use of correct language, sentences, spelling and punctuations. Errors committed in such areas my completely alter what you intended to communicate in your dissertations. Another requirement is that your dissertation papers should be
  • 2017-10-10 20:57:03
    Writing a medical thesis or dissertation is a task done by almost all postgraduate and master's medical students. Dissertation is derived from the Latin word disserto which means discuss. It is essential to write successful medical papers such as medicine essays and medical thesis papers. There are several reasons as to why students write medicine essays. One of the reasons is to promote enhancement of critical judgment, research skills as well as analytical skills. Moreover, medicine essay writing produce students with the ability to 4evaluate and analyze data critically.

    The initial step for writing medicine essays is to choose a topic. A writer should have at least three topics to choose from. The topic has to be interesting, feasible and relevant. It is essential to write quality medicine essay. Hence, students need to have analytical skills and perfect writing skills. The writing skills will enable them write outstanding essay papers that can be highly regarded by instructors and professors. Teachers often require a lot and expect a lot from their students in terms of medicine essay writing. for this reason, students find essay writing to be an extremely difficult task and hence resort to buying custom medicine essays.

    A custom medicine essay has to be written by professional writers who are qualified in the field of nursing. Moreover, the custom medicine essay has to be original and plagiarism free. This means that it has to be written from scratch by experts with many years experience. The many years experience should enable a writer to write any form of medical paper including medical thesis, medicine essay and even medicine research paper. Moreover, experience will enable a writer to write a medicine essay that can guarantee academic success.

    Students get custom medicine essays from custom writing company. It is essential to choose the best company so that one can get the best custom medicine essay. The best and the most reliable medicine essay writing company should have some unique characteristics such as affordability and the ability to provide original and superior quality medicine essays. The other quality is that the company has to hire expert writers who can write quality medicine essays and other types of medical papers. The essays should not only be quality but also plagiarism free and free of grammatical and spelling mistakes.

    A custom medicine essay has a similar structure to any other academic essay assignment. It has an introduction that introduces the topic and tells the reader what the essay is all about. The second section is the body that has many paragraphs supporting the main topic. Finally there is the conclusion that briefly summarizes what has been discussed in the body section of the essay. Students should choose reliable writing companies so that they can get quality custom papers on several fields such as technology, sociology and law in addition to medicine field.

    Our custom writing comp
  • 2017-12-03 12:00:07
    A Biological Masterpiece, But Subject to Many Ills
    The human foot is a biological masterpiece. Its strong, flexible, and functional design enables it to do its job well and without complaint—if you take care of it and don't take it for granted.
    healthThe foot can be compared to a finely tuned race car, or a space shuttle, vehicles whose function dictates their design and structure. And like them, the human foot is complex, containing within its relatively small size 26 bones (the two feet contain a quarter of all the bones in the body), 33 joints, and a network of more than 100 tendons, muscles, and ligaments, to say nothing of blood vessels and nerves.
    <a href=https://www.cialissansordonnancefr24.com/prix-cialis-5/>https://www.cialissansordonnancefr24.com/prix-cialis-5/</a>
  • Log in or sign up to reply to this thread