well,here we are.i finished the mob and everything.yet this happens when spawned in by singleplayer commands
(i added my entity to entitylist.java,from what i know thats the only way i can spawn it in by setting its idnumber from there)it appears like a white small pig and the game starts to glitch(trees that where not there,getting stuck in things)
ok here are my codes:
Mod_Redninja
package net.minecraft.src;
import java.util.Map;
public class mod_Redninja extends BaseMod
{
public void JWorldAddMobs()
{
ModLoader.RegisterEntityID(JWorld_RedninjaEntity.class, "Redninja", ModLoader.getUniqueEntityId());
ModLoader.AddSpawn(JWorld_RedninjaEntity.class, 100, EnumCreatureType.creature);
}
public void AddRenderer(Map map)
{
map.put(JWorld_RedninjaEntity.class, new JWorld_RedninjaRender(new JWorld_RedninjaModel(), 0.5F));
}
public String Version()
{
return null;
}
}
Redninjaentity
package net.minecraft.src;
public class JWorld_RedninjaEntity extends EntityAnimal
{
public JWorld_RedninjaEntity(World world)
{
super(world);
texture = "/mob/Redninja.png";
setSize(0.9F,1.3F);
moveSpeed = 0.75F;
//yOffset *= 6F;
health = 10;
}
public void writeEntityToNBT(NBTTagCompound nbttagcompound)
{
super.writeEntityToNBT(nbttagcompound);
}
public void readEntityFromNBT(NBTTagCompound nbttagcompound)
{
super.readEntityFromNBT(nbttagcompound);
}
//fields
public ModelRenderer head;
public ModelRenderer body;
public ModelRenderer leg1;
public ModelRenderer leg2;
public ModelRenderer leg3;
public ModelRenderer leg4;
You told String Version to return null which I don't think works, just put a number. (AKA verion of the game or your mod; my mod uses 1.0 (since I didn't release yet :tongue.gif:))
like so:
public String Version()
{
return "Red Ninja mod version 1.0";
}
Just out of curiousity, why did you create a new renderNyan method? I don't think I have ever stated to do that. By making a method with code to be called, something must call that method. Do you know where renderNyan is called? Probably no where. The renderLivingLabel call goes in near the top, in the method doRenderLiving.
well,here we are.i finished the mob and everything.yet this happens when spawned in by singleplayer commands
(i added my entity to entitylist.java,from what i know thats the only way i can spawn it in by setting its idnumber from there)it appears like a white small pig and the game starts to glitch(trees that where not there,getting stuck in things)
ok here are my codes:
Mod_Redninja
package net.minecraft.src;
import java.util.Map;
public class mod_Redninja extends BaseMod
{
public void JWorldAddMobs()
{
ModLoader.RegisterEntityID(JWorld_RedninjaEntity.class, "Redninja", ModLoader.getUniqueEntityId());
ModLoader.AddSpawn(JWorld_RedninjaEntity.class, 100, EnumCreatureType.creature);
}
public void AddRenderer(Map map)
{
map.put(JWorld_RedninjaEntity.class, new JWorld_RedninjaRender(new JWorld_RedninjaModel(), 0.5F));
}
public String Version()
{
return null;
}
}
Redninjaentity
package net.minecraft.src;
public class JWorld_RedninjaEntity extends EntityAnimal
{
public JWorld_RedninjaEntity(World world)
{
super(world);
texture = "/mob/Redninja.png";
setSize(0.9F,1.3F);
moveSpeed = 0.75F;
//yOffset *= 6F;
health = 10;
}
public void writeEntityToNBT(NBTTagCompound nbttagcompound)
{
super.writeEntityToNBT(nbttagcompound);
}
public void readEntityFromNBT(NBTTagCompound nbttagcompound)
{
super.readEntityFromNBT(nbttagcompound);
}
//fields
public ModelRenderer head;
public ModelRenderer body;
public ModelRenderer leg1;
public ModelRenderer leg2;
public ModelRenderer leg3;
public ModelRenderer leg4;
I notice that in your addbox calls in your model file, you don't follow the addbox(Float,Float,Float,int,int,int,Float) requirement.
Ok, for the last time, does anyone use eclipse? Really? Eclipse would prevent you from running the code with these errors. If you highlight the error marker, it will tell you what your error means. You can also run your code without having to close, recompile, obvuscate (or what ever). It's a real time saver, and it helps with the code. I have to say this so much, I might as well make a quick vid showing how useful it is. Trust me. It is worth the time to find a tutorial on getting it set up.
Here is the eclipse Download If people need it!
Also Good job with the convert video... It is true I have used eclipse for a while now...
It also auto completes some code too!
I have it working now, thanks a lot for the help :biggrin.gif: And I do use Eclipse.
No problem. Sorry if my reply was snarky... too many "should be using eclipse" messages to me at that time... had to make the video... feel better now. :cool.gif:
Ok for l those that have asked, "Why does my snout not rotate with the head right?" Well, I just figured it out. Working on a riding mob tut right now, and in making a horse, I ran into the same issue. Want to fix it? here's how. The down side is that since Techne cannot view the rotation point in relation to the world, this is kind of hard. What you need to do is set the rotation point for the snout to the same spot (or as close as possible) to that of the head.
Do you know if this program has a "scale model" option? the GI scale doesn't work perfectly and does not include the rotation balls (they still use the normal grid when the model has shrunken and if I move any box alot the ball continually offsets from the box)
Got everything working, made a spawning block and everything, however... when i click the block I get an error...
java.lang.NullPointerException
at net.minecraft.src.BlockExample.onBlockClicked(BlockExample.java:32)
at net.minecraft.src.PlayerControllerSP.clickBlock(PlayerControllerSP.java:63)
at net.minecraft.client.Minecraft.clickMouse(Minecraft.java:820)
at net.minecraft.client.Minecraft.runTick(Minecraft.java:1047)
at net.minecraft.client.Minecraft.run(Minecraft.java:480)
at java.lang.Thread.run(Unknown Source)
Heeellooo,
first of all: Thanks for doing this for us!! =)
I have a little problem: I've tried to make Herobrine but it didn't work.. Everything compiled fine untill the last script.. The mod_AddSpawnMob.. When i try to recompile it says this:
I don't know much on the compiling errors, nor will I get into them. Read my sig, and watch the video on eclipse. I have never compiled my code, so I don't see these errors. I cannot help with them
I have been playing with the code and i have added this:
[video cut]
But at the moment I have the problem of each Nyan cat being renamed and when a new cat is spawned every cat is changed to "Nyan Cat", hopefully i can fix this soon.
How do you name them in your code (not change the name, initially set the name). It could be that you are overriding it for the entity, instead of just the instance of the mob
Actually, no. this is just the bounding box/hit box for the mob. Scale is done as I have shown it in the render java file. I have used to scale down my gnome, and scale up my horse. It works. here is the code in my gnome render java file:
java.lang.NullPointerException
at net.minecraft.src.BlockExample.onBlockClicked(BlockExample.java:32)
at net.minecraft.src.PlayerControllerSP.clickBlock(PlayerControllerSP.java:63)
at net.minecraft.client.Minecraft.clickMouse(Minecraft.java:820)
at net.minecraft.client.Minecraft.runTick(Minecraft.java:1047)
at net.minecraft.client.Minecraft.run(Minecraft.java:480)
at java.lang.Thread.run(Unknown Source)
i am having troubles with my texturing on my model, i dont know if it's due it's size or what o.O
Here is the model preview of upcomming (first) mod: Preview model
(*chubby miner companion*)
as u see the textures are messed up. i did follow all 3 of ur tutorials, first i had the 96dpi-fault pop-up, i managed to fix that(so now it wont pop-up).
here i tried to fix it with the dimensions of which were been told to use in the tutorial(64x32): 64x32 dimensions
nothing in my point of view actually changed. so i thaught i could expand the dimensions to a cube form: 64x64 dimensions
Now my question is, How do manage my textures? i tried many width's and heights but the textures of my model do not fit in at the texture-manager(right-top corner). i mean, they just overlap each other. Do u have any idea how to fix it? or could you(or maybe other fellow forum-members)give me the right .png for my model?
if it matters; my model sizes are: 24blocks in width and 28blocks in height.
Thanks in advance,
Shane.
texturing is a tricky business even when it is easy. In this case, we are limited to the size of the texture to 64x32. This cannot (that I know of) be changed. What else makes it hard is that the mapping is preset, and can't be changed.
Here is my advice:
keep the blocks relatively small, but within reason. The texture would be 1 to 1 pixels. a 8x8 head seems average. if you need a big model, scale it in the render java file.
focus on the detailed parts (like the face), try and overlap the others (like body and arms/legs)
It's all I got for you. This is something that is hard to teach, it's more trial and error.
java.lang.NullPointerException
at net.minecraft.src.BlockExample.onBlockClicked(BlockExample.java:32)
at net.minecraft.src.PlayerControllerSP.clickBlock(PlayerControllerSP.java:63)
at net.minecraft.client.Minecraft.clickMouse(Minecraft.java:820)
at net.minecraft.client.Minecraft.runTick(Minecraft.java:1047)
at net.minecraft.client.Minecraft.run(Minecraft.java:480)
at java.lang.Thread.run(Unknown Source)
package net.minecraft.src;
import java.util.Random;
// Referenced classes of package net.minecraft.src:
// Block, Material, Item
public class JWorld_SpawnerBlock extends Block
{
public JWorld_SpawnerBlock(int i, int j)
{
super(i, j, Material.sand); //allows it to be harvested by hand.
}
public int idDropped(int i, Random random)
{
return mod_JWorld.JWorld_SpawnSpot.blockID;
}
//making buildings
//can try boolean blockActivated(World world, int i, int j, int k, EntityPlayer entityplayer)
public void onBlockClicked(World world, int i, int j, int k, EntityPlayer entityplayer)
{
//i left/right (x pos)
//j up/down (y pos)
//k back/forth (z pos)
//Try to spawn above this (j/y = +1)
EntityLiving entityliving = (EntityLiving)EntityList.createEntityInWorld("Crab", entityplayer.worldObj);
entityliving.setLocationAndAngles(i, j + 1, k, 0F, 0F); //x, y, z, yaw, pitch
entityplayer.worldObj.entityJoinedWorld(entityliving);
}
}
Would like to note that in Eclipse, I am getting an error for return mod_JWorld.JWorld_SpawnSpot.blockID; claiming blockID cannot be resolved or is not a field. And my previous block name (from the post above) has changed...
How can I give two texture to my mod and how can I assign which parts are on which texture? (I'm asking this because my mob is to big to have only one texture)
Rollback Post to RevisionRollBack
Each day is a gift and not a given right, so live them all like your last
package net.minecraft.src;
import java.util.Random;
// Referenced classes of package net.minecraft.src:
// Block, Material, Item
public class JWorld_SpawnerBlock extends Block
{
public JWorld_SpawnerBlock(int i, int j)
{
super(i, j, Material.sand); //allows it to be harvested by hand.
}
public int idDropped(int i, Random random)
{
return mod_JWorld.JWorld_SpawnSpot.blockID;
}
//making buildings
//can try boolean blockActivated(World world, int i, int j, int k, EntityPlayer entityplayer)
public void onBlockClicked(World world, int i, int j, int k, EntityPlayer entityplayer)
{
//i left/right (x pos)
//j up/down (y pos)
//k back/forth (z pos)
//Try to spawn above this (j/y = +1)
EntityLiving entityliving = (EntityLiving)EntityList.createEntityInWorld("Crab", entityplayer.worldObj);
entityliving.setLocationAndAngles(i, j + 1, k, 0F, 0F); //x, y, z, yaw, pitch
entityplayer.worldObj.entityJoinedWorld(entityliving);
}
}
Would like to note that in Eclipse, I am getting an error for return mod_JWorld.JWorld_SpawnSpot.blockID; claiming blockID cannot be resolved or is not a field. And my previous block name (from the post above) has changed...
If you watched my video, if you mouse over the red X or the text with the error, it will tell you what is wrong. As to why it crashes, the error is pointing to BlockExample.onBlockClicked, not this code. Are you sure you are building the block right? Go back to the basics of creating a block.
You told String Version to return null which I don't think works, just put a number. (AKA verion of the game or your mod; my mod uses 1.0 (since I didn't release yet :tongue.gif:))
like so:
Although I don't think that's your problem.
Just out of curiousity, why did you create a new renderNyan method? I don't think I have ever stated to do that. By making a method with code to be called, something must call that method. Do you know where renderNyan is called? Probably no where. The renderLivingLabel call goes in near the top, in the method doRenderLiving.
OLD 1.7: http://www.minecraftforum.net/topic/529327-modloader173-adding-custom-mobs-and-more/ ---inLanoche says : USE ECLIPSE
I notice that in your addbox calls in your model file, you don't follow the addbox(Float,Float,Float,int,int,int,Float) requirement.
Ok, for the last time, does anyone use eclipse? Really? Eclipse would prevent you from running the code with these errors. If you highlight the error marker, it will tell you what your error means. You can also run your code without having to close, recompile, obvuscate (or what ever). It's a real time saver, and it helps with the code. I have to say this so much, I might as well make a quick vid showing how useful it is. Trust me. It is worth the time to find a tutorial on getting it set up.
OLD 1.7: http://www.minecraftforum.net/topic/529327-modloader173-adding-custom-mobs-and-more/ ---inLanoche says : USE ECLIPSE
Need to get started, watch this vid:
OLD 1.7: http://www.minecraftforum.net/topic/529327-modloader173-adding-custom-mobs-and-more/ ---inLanoche says : USE ECLIPSE
Also Good job with the convert video... It is true I have used eclipse for a while now...
It also auto completes some code too!
http://www.eclipse.org/downloads/
No problem. Sorry if my reply was snarky... too many "should be using eclipse" messages to me at that time... had to make the video... feel better now. :cool.gif:
OLD 1.7: http://www.minecraftforum.net/topic/529327-modloader173-adding-custom-mobs-and-more/ ---inLanoche says : USE ECLIPSE
Ok for l those that have asked, "Why does my snout not rotate with the head right?" Well, I just figured it out. Working on a riding mob tut right now, and in making a horse, I ran into the same issue. Want to fix it? here's how. The down side is that since Techne cannot view the rotation point in relation to the world, this is kind of hard. What you need to do is set the rotation point for the snout to the same spot (or as close as possible) to that of the head.
OLD 1.7: http://www.minecraftforum.net/topic/529327-modloader173-adding-custom-mobs-and-more/ ---inLanoche says : USE ECLIPSE
My mod file:
found this in giantzombie code :wink.gif:
I don't know much on the compiling errors, nor will I get into them. Read my sig, and watch the video on eclipse. I have never compiled my code, so I don't see these errors. I cannot help with them
OLD 1.7: http://www.minecraftforum.net/topic/529327-modloader173-adding-custom-mobs-and-more/ ---inLanoche says : USE ECLIPSE
How do you name them in your code (not change the name, initially set the name). It could be that you are overriding it for the entity, instead of just the instance of the mob
OLD 1.7: http://www.minecraftforum.net/topic/529327-modloader173-adding-custom-mobs-and-more/ ---inLanoche says : USE ECLIPSE
Actually, no. this is just the bounding box/hit box for the mob. Scale is done as I have shown it in the render java file. I have used to scale down my gnome, and scale up my horse. It works. here is the code in my gnome render java file:
you can see how small he is (actually built the same size as the average mob) in my color changing vid.
OLD 1.7: http://www.minecraftforum.net/topic/529327-modloader173-adding-custom-mobs-and-more/ ---inLanoche says : USE ECLIPSE
texturing is a tricky business even when it is easy. In this case, we are limited to the size of the texture to 64x32. This cannot (that I know of) be changed. What else makes it hard is that the mapping is preset, and can't be changed.
Here is my advice:
keep the blocks relatively small, but within reason. The texture would be 1 to 1 pixels. a 8x8 head seems average. if you need a big model, scale it in the render java file.
focus on the detailed parts (like the face), try and overlap the others (like body and arms/legs)
It's all I got for you. This is something that is hard to teach, it's more trial and error.
OLD 1.7: http://www.minecraftforum.net/topic/529327-modloader173-adding-custom-mobs-and-more/ ---inLanoche says : USE ECLIPSE
post your code for onBlockClicked.
OLD 1.7: http://www.minecraftforum.net/topic/529327-modloader173-adding-custom-mobs-and-more/ ---inLanoche says : USE ECLIPSE
Would like to note that in Eclipse, I am getting an error for return mod_JWorld.JWorld_SpawnSpot.blockID; claiming blockID cannot be resolved or is not a field. And my previous block name (from the post above) has changed...
If you watched my video, if you mouse over the red X or the text with the error, it will tell you what is wrong. As to why it crashes, the error is pointing to BlockExample.onBlockClicked, not this code. Are you sure you are building the block right? Go back to the basics of creating a block.
OLD 1.7: http://www.minecraftforum.net/topic/529327-modloader173-adding-custom-mobs-and-more/ ---inLanoche says : USE ECLIPSE