So what if you wanted to use a chisel to craft a shiny green gem instead of tossing it in a furnace? You would use the chisel and the regular green gem in a shapeless crafting recipe, HOWEVER, you would get the chisel back along with the new shiny gem.
What I'm saying is: Using a tool with an item to craft something, and receiving the new item and the tool you used.
Replace This Line of Code:
//
ModLoader.addSpawn("NAME", 15, -5, 1, EnumCreatureType.monster);
//
With This Line of Code To Make It Spawn In A Specific Biome:
//
ModLoader.addSpawn(EntityChangeToEntityName.class, 15, -5, 1, EnumCreatureType.monster, new BiomeGenBase[]
{
BiomeGenBase.BiomeNameHere,
});
//
when making a mob from your tutorial the mob i made doesn't have a texture in game but i put its texture file int the right place
classes & texture
mod_FishMan.class
package net.minecraft.src;
import java.awt.Color;
import java.util.Map;
public class mod_FishManDB extends BaseMod
{
public String getVersion()
{
return "1.4.2";
}
public void load()
{
ModLoader.registerEntityID(EntityFishMan.class, "Fish Man", 30);//registers the mobs name and id
ModLoader.addSpawn("Fish Man", 15, -5, 1, EnumCreatureType.creature);//makes the mob spawn in game
ModLoader.addLocalization("entity.Fish Man.name", "Spawn Fish Man");//adds Mob name on the spawn egg
EntityList.entityEggs.put(Integer.valueOf(30), new EntityEggInfo(30, 894731, (new Color(21, 15, 6)).getRGB()));//creates the spawn egg, and chnages color of egg
}
public void addRenderer(Map var1)
{
var1.put(EntityFishMan.class, new RenderLiving(new ModelFishMan(),.5f));
}
}
EntityFishMan
package net.minecraft.src;
public class EntityFishMan extends EntityMob//extend this to make mob hostile
{
public EntityFishMan(World par1World)
{
super(par1World);
this.texture = "/mob/FishMan.PNG image";//Set Mob texture
this.moveSpeed = 0.1f;//sets how fast this mob moves
isImmuneToFire = true;
//below this is all the ai tasks that specify how the mob will behave mess around with it to see what happens
this.tasks.addTask(0, new EntityAISwimming(this));
this.tasks.addTask(1, new EntityAIAttackOnCollide(this, EntityPlayer.class, this.moveSpeed, false));
this.tasks.addTask(2, new EntityAIMoveTwardsRestriction(this, this.moveSpeed));
this.tasks.addTask(3, new EntityAIWander(this, this.moveSpeed));
this.tasks.addTask(4, new EntityAILookIdle(this));
this.targetTasks.addTask(0, new EntityAIHurtByTarget(this, false));
this.targetTasks.addTask(1, new EntityAINearestAttackableTarget(this, EntityPlayer.class, 25.0F, 0, true));
}
public int func_82193_c(Entity par1Entity) //the amount of damage
{
return 4;
}
protected void fall(float par1) {}
public int getMaxHealth() // Mob health
{
return 10;
}
27 achievements
210 recipes
Setting user: Player34, -
Client asked for parameter: server
LWJGL Version: 2.4.2
JavaVM WARNING: JAWT_GetAWT must be called after loading a JVM
org.lwjgl.LWJGLException: Could not get the JAWT interface
at org.lwjgl.opengl.AWTSurfaceLock.lockAndInitHandle(Native Method)
at org.lwjgl.opengl.AWTSurfaceLock.access$100(AWTSurfaceLock.java:49)
at org.lwjgl.opengl.AWTSurfaceLock$1.run(AWTSurfaceLock.java:89)
at java.security.AccessController.doPrivileged(Native Method)
at org.lwjgl.opengl.AWTSurfaceLock.privilegedLockAndInitHandle(AWTSurfaceLock.java:86)
at org.lwjgl.opengl.AWTSurfaceLock.lockAndGetHandle(AWTSurfaceLock.java:64)
at org.lwjgl.opengl.MacOSXCanvasPeerInfo.initHandle(MacOSXCanvasPeerInfo.java:53)
at org.lwjgl.opengl.MacOSXDisplayPeerInfo.doLockAndInitHandle(MacOSXDisplayPeerInfo.java:56)
at org.lwjgl.opengl.PeerInfo.lockAndGetHandle(PeerInfo.java:85)
at org.lwjgl.opengl.MacOSXContextImplementation.create(MacOSXContextImplementation.java:47)
at org.lwjgl.opengl.Context.<init>(Context.java:120)
at org.lwjgl.opengl.Display.create(Display.java:858)
at org.lwjgl.opengl.Display.create(Display.java:784)
at net.minecraft.client.Minecraft.startGame(Minecraft.java:382)
at net.minecraft.src.MinecraftAppletImpl.startGame(MinecraftAppletImpl.java:41)
at net.minecraft.client.Minecraft.run(Minecraft.java:741)
at java.lang.Thread.run(Thread.java:722)
JavaVM WARNING: JAWT_GetAWT must be called after loading a JVM
org.lwjgl.LWJGLException: Could not get the JAWT interface
at org.lwjgl.opengl.AWTSurfaceLock.lockAndInitHandle(Native Method)
at org.lwjgl.opengl.AWTSurfaceLock.access$100(AWTSurfaceLock.java:49)
at org.lwjgl.opengl.AWTSurfaceLock$1.run(AWTSurfaceLock.java:89)
at java.security.AccessController.doPrivileged(Native Method)
at org.lwjgl.opengl.AWTSurfaceLock.privilegedLockAndInitHandle(AWTSurfaceLock.java:86)
at org.lwjgl.opengl.AWTSurfaceLock.lockAndGetHandle(AWTSurfaceLock.java:64)
at org.lwjgl.opengl.MacOSXCanvasPeerInfo.initHandle(MacOSXCanvasPeerInfo.java:53)
at org.lwjgl.opengl.MacOSXDisplayPeerInfo.doLockAndInitHandle(MacOSXDisplayPeerInfo.java:56)
at org.lwjgl.opengl.PeerInfo.lockAndGetHandle(PeerInfo.java:85)
at org.lwjgl.opengl.MacOSXContextImplementation.create(MacOSXContextImplementation.java:47)
at org.lwjgl.opengl.Context.<init>(Context.java:120)
at org.lwjgl.opengl.Display.create(Display.java:858)
at org.lwjgl.opengl.Display.create(Display.java:784)
at org.lwjgl.opengl.Display.create(Display.java:765)
at net.minecraft.client.Minecraft.startGame(Minecraft.java:397)
at net.minecraft.src.MinecraftAppletImpl.startGame(MinecraftAppletImpl.java:41)
at net.minecraft.client.Minecraft.run(Minecraft.java:741)
at java.lang.Thread.run(Thread.java:722)
Someone is closing me!
Hey, i've just watched ' Lets make a mod Ep 2 (Adding a item) ' The coding has no errors what so ever but when i run my minecraft in eclipse it crashes Help!
Hey, i've just watched ' Lets make a mod Ep 2 (Adding a item) ' The coding has no errors what so ever but when i run my minecraft in eclipse it crashes Help!
I may be able to assist you! If you have Skype, add filkie10
Replace This Line of Code:
//
ModLoader.addSpawn("NAME", 15, -5, 1, EnumCreatureType.monster);
//
With This Line of Code To Make It Spawn In A Specific Biome:
//
ModLoader.addSpawn(EntityChangeToEntityName.class, 15, -5, 1, EnumCreatureType.monster, new BiomeGenBase[]
{
BiomeGenBase.BiomeNameHere,
});
//
You can get one too!
>> ** <<
I have a suggestion for a tutorial:
So what if you wanted to use a chisel to craft a shiny green gem instead of tossing it in a furnace? You would use the chisel and the regular green gem in a shapeless crafting recipe, HOWEVER, you would get the chisel back along with the new shiny gem.
What I'm saying is: Using a tool with an item to craft something, and receiving the new item and the tool you used.
Added to the list
Added to the list
Can you add drinks?
//
ModLoader.addSpawn("NAME", 15, -5, 1, EnumCreatureType.monster);
//
With This Line of Code To Make It Spawn In A Specific Biome:
//
ModLoader.addSpawn(EntityChangeToEntityName.class, 15, -5, 1, EnumCreatureType.monster, new BiomeGenBase[]
{
BiomeGenBase.BiomeNameHere,
});
//
classes & texture
mod_FishMan.class
package net.minecraft.src;
import java.awt.Color;
import java.util.Map;
public class mod_FishManDB extends BaseMod
{
public String getVersion()
{
return "1.4.2";
}
public void load()
{
ModLoader.registerEntityID(EntityFishMan.class, "Fish Man", 30);//registers the mobs name and id
ModLoader.addSpawn("Fish Man", 15, -5, 1, EnumCreatureType.creature);//makes the mob spawn in game
ModLoader.addLocalization("entity.Fish Man.name", "Spawn Fish Man");//adds Mob name on the spawn egg
EntityList.entityEggs.put(Integer.valueOf(30), new EntityEggInfo(30, 894731, (new Color(21, 15, 6)).getRGB()));//creates the spawn egg, and chnages color of egg
}
public void addRenderer(Map var1)
{
var1.put(EntityFishMan.class, new RenderLiving(new ModelFishMan(),.5f));
}
}
EntityFishMan
package net.minecraft.src;
public class EntityFishMan extends EntityMob//extend this to make mob hostile
{
public EntityFishMan(World par1World)
{
super(par1World);
this.texture = "/mob/FishMan.PNG image";//Set Mob texture
this.moveSpeed = 0.1f;//sets how fast this mob moves
isImmuneToFire = true;
//below this is all the ai tasks that specify how the mob will behave mess around with it to see what happens
this.tasks.addTask(0, new EntityAISwimming(this));
this.tasks.addTask(1, new EntityAIAttackOnCollide(this, EntityPlayer.class, this.moveSpeed, false));
this.tasks.addTask(2, new EntityAIMoveTwardsRestriction(this, this.moveSpeed));
this.tasks.addTask(3, new EntityAIWander(this, this.moveSpeed));
this.tasks.addTask(4, new EntityAILookIdle(this));
this.targetTasks.addTask(0, new EntityAIHurtByTarget(this, false));
this.targetTasks.addTask(1, new EntityAINearestAttackableTarget(this, EntityPlayer.class, 25.0F, 0, true));
}
public int func_82193_c(Entity par1Entity) //the amount of damage
{
return 4;
}
protected void fall(float par1) {}
public int getMaxHealth() // Mob health
{
return 10;
}
protected String getLivingSound()
{
return "mob.pig.say";
}
protected String getHurtSound()
{
return "mob.pig.say";
}
protected String getDeathSound()
{
return "mob.pig.death";
}
protected int getDropItemId()
{
return mod_DB.greengem.itemID;
}
protected boolean canDespawn()
{
return true;
}
protected boolean isAIEnabled()//Allow your AI task to work?
{
return true;
}
}
modelFishMan
package net.minecraft.src;
public class ModelFishMan extends ModelBase
{
//fields
ModelRenderer Shape1;
ModelRenderer Shape2;
ModelRenderer Shape3;
ModelRenderer Shape4;
ModelRenderer Shape5;
ModelRenderer Shape6;
ModelRenderer Shape7;
public ModelFishMan()
{
textureWidth = 64;
textureHeight = 64;
Shape1 = new ModelRenderer(this, 32, 1);
Shape1.addBox(-4F, -7F, -4F, 8, 8, 8);
Shape1.setRotationPoint(0F, 7F, 0F);
Shape1.setTextureSize(64, 64);
Shape1.mirror = true;
setRotation(Shape1, 0F, 0F, 0F);
Shape2 = new ModelRenderer(this, 36, 20);
Shape2.addBox(-4F, 0F, -2F, 8, 9, 5);
Shape2.setRotationPoint(0F, 8F, -1F);
Shape2.setTextureSize(64, 64);
Shape2.mirror = true;
setRotation(Shape2, 0F, 0F, 0F);
Shape3 = new ModelRenderer(this, 1, 20);
Shape3.addBox(-4F, 0F, -2F, 6, 9, 5);
Shape3.setRotationPoint(1F, 16F, -1F);
Shape3.setTextureSize(64, 64);
Shape3.mirror = true;
setRotation(Shape3, 0.6981317F, 0F, 0F);
Shape4 = new ModelRenderer(this, 38, 38);
Shape4.addBox(-4F, 0F, -2F, 6, 9, 5);
Shape4.setRotationPoint(1F, 22F, 3F);
Shape4.setTextureSize(64, 64);
Shape4.mirror = true;
setRotation(Shape4, 1.570796F, 0F, 0F);
Shape5 = new ModelRenderer(this, 2, 5);
Shape5.addBox(-5F, 0F, 0F, 10, 6, 3);
Shape5.setRotationPoint(0F, 23F, 11F);
Shape5.setTextureSize(64, 64);
Shape5.mirror = true;
setRotation(Shape5, 1.570796F, 0F, 0F);
Shape6 = new ModelRenderer(this, 19, 36);
Shape6.addBox(0F, -2F, -2F, 4, 13, 4);
Shape6.setRotationPoint(4F, 11F, 0F);
Shape6.setTextureSize(64, 64);
Shape6.mirror = true;
setRotation(Shape6, 0F, 0F, 0F);
Shape7 = new ModelRenderer(this, 1, 36);
Shape7.addBox(-4F, 5F, -2F, 4, 13, 4);
Shape7.setRotationPoint(-4F, 4F, 0F);
Shape7.setTextureSize(64, 64);
Shape7.mirror = true;
setRotation(Shape7, 0F, 0F, 0F);
}
public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5)
{
super.render(entity, f, f1, f2, f3, f4, f5);
setRotationAngles(f, f1, f2, f3, f4, f5);
Shape1.render(f5);
Shape2.render(f5);
Shape3.render(f5);
Shape4.render(f5);
Shape5.render(f5);
Shape6.render(f5);
Shape7.render(f5);
}
private void setRotation(ModelRenderer model, float x, float y, float z)
{
model.rotateAngleX = x;
model.rotateAngleY = y;
model.rotateAngleZ = z;
}
public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5)
{
// super.setRotationAngles(f, f1, f2, f3, f4, f5);
}
}
Are the codes right?
mod_sandstoneshard
package net.minecraft.src; import java.util.Random; public class mod_sandstoneshard extends BaseMod { public static final Item sandstoneshard = new ItemSandstoneShard(2665).setItemName("sandstoneshard"); public void load() { sandstoneshard.iconIndex = ModLoader.addOverride("/gui/items.png" , "/items/shard.png"); ModLoader.addName(sandstoneshard, "Green Gem"); } public String getVersion() { return "3.14159265"; } }ItemSandstoneShard
package net.minecraft.src; import java.util.Random; public class ItemSandstoneShard extends Item { public ItemSandstoneShard(int i) { super(i); maxStackSize = 64; } public String Version() { return "3.14159265"; } }Please, someone answer. I cannot test my mod if it is working. I don't have any errors or warnings.
27 achievements
210 recipes
Setting user: Player34, -
Client asked for parameter: server
LWJGL Version: 2.4.2
JavaVM WARNING: JAWT_GetAWT must be called after loading a JVM
org.lwjgl.LWJGLException: Could not get the JAWT interface
at org.lwjgl.opengl.AWTSurfaceLock.lockAndInitHandle(Native Method)
at org.lwjgl.opengl.AWTSurfaceLock.access$100(AWTSurfaceLock.java:49)
at org.lwjgl.opengl.AWTSurfaceLock$1.run(AWTSurfaceLock.java:89)
at java.security.AccessController.doPrivileged(Native Method)
at org.lwjgl.opengl.AWTSurfaceLock.privilegedLockAndInitHandle(AWTSurfaceLock.java:86)
at org.lwjgl.opengl.AWTSurfaceLock.lockAndGetHandle(AWTSurfaceLock.java:64)
at org.lwjgl.opengl.MacOSXCanvasPeerInfo.initHandle(MacOSXCanvasPeerInfo.java:53)
at org.lwjgl.opengl.MacOSXDisplayPeerInfo.doLockAndInitHandle(MacOSXDisplayPeerInfo.java:56)
at org.lwjgl.opengl.PeerInfo.lockAndGetHandle(PeerInfo.java:85)
at org.lwjgl.opengl.MacOSXContextImplementation.create(MacOSXContextImplementation.java:47)
at org.lwjgl.opengl.Context.<init>(Context.java:120)
at org.lwjgl.opengl.Display.create(Display.java:858)
at org.lwjgl.opengl.Display.create(Display.java:784)
at net.minecraft.client.Minecraft.startGame(Minecraft.java:382)
at net.minecraft.src.MinecraftAppletImpl.startGame(MinecraftAppletImpl.java:41)
at net.minecraft.client.Minecraft.run(Minecraft.java:741)
at java.lang.Thread.run(Thread.java:722)
JavaVM WARNING: JAWT_GetAWT must be called after loading a JVM
org.lwjgl.LWJGLException: Could not get the JAWT interface
at org.lwjgl.opengl.AWTSurfaceLock.lockAndInitHandle(Native Method)
at org.lwjgl.opengl.AWTSurfaceLock.access$100(AWTSurfaceLock.java:49)
at org.lwjgl.opengl.AWTSurfaceLock$1.run(AWTSurfaceLock.java:89)
at java.security.AccessController.doPrivileged(Native Method)
at org.lwjgl.opengl.AWTSurfaceLock.privilegedLockAndInitHandle(AWTSurfaceLock.java:86)
at org.lwjgl.opengl.AWTSurfaceLock.lockAndGetHandle(AWTSurfaceLock.java:64)
at org.lwjgl.opengl.MacOSXCanvasPeerInfo.initHandle(MacOSXCanvasPeerInfo.java:53)
at org.lwjgl.opengl.MacOSXDisplayPeerInfo.doLockAndInitHandle(MacOSXDisplayPeerInfo.java:56)
at org.lwjgl.opengl.PeerInfo.lockAndGetHandle(PeerInfo.java:85)
at org.lwjgl.opengl.MacOSXContextImplementation.create(MacOSXContextImplementation.java:47)
at org.lwjgl.opengl.Context.<init>(Context.java:120)
at org.lwjgl.opengl.Display.create(Display.java:858)
at org.lwjgl.opengl.Display.create(Display.java:784)
at org.lwjgl.opengl.Display.create(Display.java:765)
at net.minecraft.client.Minecraft.startGame(Minecraft.java:397)
at net.minecraft.src.MinecraftAppletImpl.startGame(MinecraftAppletImpl.java:41)
at net.minecraft.client.Minecraft.run(Minecraft.java:741)
at java.lang.Thread.run(Thread.java:722)
Someone is closing me!
Cannot invoke setTabToDisplayOn(CreativeTabs) on the primitive type void
So basicly, This method is infereor. How do I add my item to a tab?
-Yoamer
THANK YOU
Make it look like this;
this.setCreativeTab(CreativeTabs.tabMaterials);
haha no, I'm just picking at random!
Post a topic on my help forums