Assuming it is attacking players and you mean finding a player to attack and not actually attacking it add this to the entity class of the mob
protected Entity findPlayerToAttack()
{
double d = 16D;//16 is usual range modify it to what you want
return worldObj.getClosestPlayerToEntity(this, d);
}
Yeah it is attacking players but no finding it's easy to change, I want it to be able to attack the player when it'S far from the player without weapons so not with a bow or something like that, but thanks for your help^^
Rollback Post to RevisionRollBack
Each day is a gift and not a given right, so live them all like your last
Yes. In the "addBox()" line, the very last variable is the scale of the model (0 being the default). If you increase that to 1, your model will be twice as large. Warning that increasing the scale can often make entities look fat and puffy, if you don't add spacing between each box when designing the model.
A much quicker, dirtier way to resize an entity is to:
1. Give the entity its own unique Render class (ie RenderTiger, RenderPuma), if it doesn't already have one.
2. Add an entry to the "entityRenderMap" hashtable in RenderManager.java that links your Entity to your new Renderer.
3. In your Render class, override RenderLiving's "preRenderCallback" method like this:
protected void preRenderCallback(EntityLiving entityliving, float f)
{
super.preRenderCallback(entityliving, f);
//Multiply the regular size by "scale". In this case, we're going jumbo...
float scale = 10F;
GL11.glScalef(scale, scale, scale);
}
Voila! Your mob has officially been resized. You can use the "setSize(int,int)" method in the Entity's constructor to readjust its collision box (but at massive sizes, he'd probably get stuck on everything, haha)
This basically works because this method is called immediately before an EntityLiving is rendered- the purpose of this method is for special rendering adjustments (ie if you wanted to hue your mob differently, resize it, rotate it, etc), so this would be a perfectly legitimate use of it!
If your mob is ginormous and you'd like to improve the texture resolution, just double the width and height of the texture your using.
Allright... So would they automatically swim and crap? How would I customize it's movment(so it like always stay at the same level in water, unless it comes close to the waters edge, so it turns around..., and custumize it's animation so it's fins go up and down)... That is what I think your advance tutorial should be about.
Thanks for mak'n this, it's been a huge help, I've already made models for all these:
whale
Giant octopus
clam
turtle
(working on a) awesome boat that is much bigger.
I haven't programed most of those yet, but whale should be done first, then clam, then turtle, then boat, then giant octopus.
I'm making all this for my multi dimensions mod, for the world aquatica.
Dude can I have a download link when your done that sounds sick!:biggrin.gif:
The tool I use for mob modeling is FMCModeler which allows you to create the texture positions, then save the template and make the texture, and then re-import it, in which you can see it on your model. It is also possible to use it online.
Here's my problem, I create two mobs with that tutorial but when I put them together, the first one I did(cyclope) doesn't spawn. (My mob's names are in french and I haven't made the sounds yet) Could someone help me? Here's the code for my two mobs:
First mob (Cyclope):
mod_Cyclope:
package net.minecraft.src;
import java.util.*;
import java.util.map;
public class mod_Cyclope extends BaseMod
{
public mod_Cyclope()
{
ModLoader.RegisterEntityID(EntityCyclope.class, "Cyclope", ModLoader.getUniqueEntityId());
ModLoader.AddSpawn(EntityCyclope.class, 100, EnumCreatureType.monster);
}
// RENDERERS
public void AddRenderer(Map map)
{
map.put(EntityCyclope.class, new RenderCyclope(new ModelCyclope(0,0), 0.5F));
}
public String Version()
{
return "Mob:Cyclope";
}
}
EntityCyclope:
// Decompiled by Jad v1.5.8g. Copyright 2001 Pavel Kouznetsov.
// Jad home page: http://www.kpdus.com/jad.html
// Decompiler options: packimports(3) braces deadcode
package net.minecraft.src;
// Referenced classes of package net.minecraft.src:
// EntityMob, World, MathHelper, Item
public class EntityCyclope extends EntityMob
{
public EntityCyclope(World world)
{
super(world);
texture = "/mob/Cyclope.png";
moveSpeed = 0.5F;
attackStrength = 50;
health *= 10;
yOffset *= 6F;
setSize(width * 6F, height * 6F);
}
public void writeEntityToNBT(NBTTagCompound nbttagcompound)
{
super.writeEntityToNBT(nbttagcompound);
}
public void readEntityFromNBT(NBTTagCompound nbttagcompound)
{
super.readEntityFromNBT(nbttagcompound);
}
protected float getBlockPathWeight(int i, int j, int k)
{
return worldObj.getLightBrightness(i, j, k) - 0.5F;
}
protected String getLivingSound()
{
return "mob.zombie";
}
protected String getHurtSound()
{
return "mob.zombiehurt";
}
protected String getDeathSound()
{
return "mob.zombiedeath";
}
protected int getDropItemId()
{
return Item.ingotIron.shiftedIndex;
}
}
Please someone help me it's for a homework and if I can't do that I may not have my diploma:S
With:
ModLoader.AddSpawn(EntityCyclope.class, 100, EnumCreatureType.monster); That 100 is the amount that spawns in a chunk... so with both with 100 spawned in a chunk, one could be overloading the amount of mobs out and keeping the other from spawning in.
If you are using the default spawn for mobs, they only spawn at night.... and or in caves.
With:
ModLoader.AddSpawn(EntityCyclope.class, 100, EnumCreatureType.monster); That 100 is the amount that spawns in a chunk... so with both with 100 spawned in a chunk, one could be overloading the amount of mobs out and keeping the other from spawning in.
If you are using the default spawn for mobs, they only spawn at night.... and or in caves.
Ok I'll try to lower that number I put that so I could find them easilyXD
Rollback Post to RevisionRollBack
Each day is a gift and not a given right, so live them all like your last
With:
ModLoader.AddSpawn(EntityCyclope.class, 100, EnumCreatureType.monster); That 100 is the amount that spawns in a chunk... so with both with 100 spawned in a chunk, one could be overloading the amount of mobs out and keeping the other from spawning in.
If you are using the default spawn for mobs, they only spawn at night.... and or in caves.
I tried that, but it didn't work... I even tried to delete the gorgon but it doesn't work either...
Rollback Post to RevisionRollBack
Each day is a gift and not a given right, so live them all like your last
Yeah it is attacking players but no finding it's easy to change, I want it to be able to attack the player when it'S far from the player without weapons so not with a bow or something like that, but thanks for your help^^
A much quicker, dirtier way to resize an entity is to:
1. Give the entity its own unique Render class (ie RenderTiger, RenderPuma), if it doesn't already have one.
2. Add an entry to the "entityRenderMap" hashtable in RenderManager.java that links your Entity to your new Renderer.
3. In your Render class, override RenderLiving's "preRenderCallback" method like this:
Voila! Your mob has officially been resized. You can use the "setSize(int,int)" method in the Entity's constructor to readjust its collision box (but at massive sizes, he'd probably get stuck on everything, haha)
This basically works because this method is called immediately before an EntityLiving is rendered- the purpose of this method is for special rendering adjustments (ie if you wanted to hue your mob differently, resize it, rotate it, etc), so this would be a perfectly legitimate use of it!
If your mob is ginormous and you'd like to improve the texture resolution, just double the width and height of the texture your using.
lol
What can I do to remove the errors?
Edit: Please respond soon.
Edit2: NEED HELP NAO!
I just took the Minecraft Noob test! Check out what I scored. Think you can beat me?!
To take the test, check out
https://minecraftnoobtest.com/test.php
Don't click this link, HE is haunting it...
Dude can I have a download link when your done that sounds sick!:biggrin.gif:
This is my Render in Techne.....
This is the mob in-game......
That's not much help, lol. I'm not the only one having this problem.
First mob (Cyclope):
mod_Cyclope:
EntityCyclope:
ModelCyclope:
RenderCyclope:
Second mob (gorgone):
mod_Gorgone:
EntityGorgone:
ModelGorgone:
RenderGorgone:
Hope someone will help me. Thanks to that person.
Xergz
With:
ModLoader.AddSpawn(EntityCyclope.class, 100, EnumCreatureType.monster); That 100 is the amount that spawns in a chunk... so with both with 100 spawned in a chunk, one could be overloading the amount of mobs out and keeping the other from spawning in.
If you are using the default spawn for mobs, they only spawn at night.... and or in caves.
pics:
Ok I'll try to lower that number I put that so I could find them easilyXD
I tried that, but it didn't work... I even tried to delete the gorgon but it doesn't work either...