The only problem I'm having is making a used tool, or weapon being used in a recipe. What would I have to change the Item.pickaxeWood to, in order for it to work in recipes? Also, where is the code for putting two of the same tool to make a fixed tool?
I get it now. Thanks. However, just one more thing. Say I make the image and name it birthdaycake.png, and when the player installs it the picture goes into the item folder. Would I change the code to this or something else?
public static Item Birthdaycake = new ItemBirthdaycake(5000, 0).setItemName ("bdaycake");
required: int
found: int,int
reason: actual and formal lists differ length
Did you delete the ItemBirthdaycake class? If not, you should have. If you did, then you just forgot to change new ItemBirthdaycake(5000, 0) to new Item(5000, 0).
Rollback Post to RevisionRollBack
I used to maintain the Minecraft Forums Mod List. However, life has stepped in the way of that. Perhaps later...
I get it now. Thanks. However, just one more thing. Say I make the image and name it birthdaycake.png, and when the player installs it the picture goes into the item folder. Would I change the code to this or something else?
public static Item Birthdaycake = new ItemBirthdaycake(5000, 0).setItemName ("bdaycake");
required: int
found: int,int
reason: actual and formal lists differ length
Items can only have one parameter. Remove the 0 in this part.
= new ItemBirthdaycake(5000, 0)
Rollback Post to RevisionRollBack
“Computers are incredibly fast, accurate and stupid; humans are incredibly slow, inaccurate and brilliant; together they are powerful beyond imagination."
“Computers are incredibly fast, accurate and stupid; humans are incredibly slow, inaccurate and brilliant; together they are powerful beyond imagination."
my bunnies appear transparent, only with bunnies texture like hat on their transparent heads. Any suggestions?
Post your code.
Rollback Post to RevisionRollBack
“Computers are incredibly fast, accurate and stupid; humans are incredibly slow, inaccurate and brilliant; together they are powerful beyond imagination."
You need to map the entity to the render and model. So, change
map.put(ModelBunny.class, new RenderBunny(new ModelBunny(), 0.5F));
to
map.put(EntityBunny.class, new RenderBunny(new ModelBunny(), 0.5F));
Rollback Post to RevisionRollBack
“Computers are incredibly fast, accurate and stupid; humans are incredibly slow, inaccurate and brilliant; together they are powerful beyond imagination."
Items can only have one parameter. Remove the 0 in this part.
= new ItemBirthdaycake(5000, 0)
Alright it's working now thanks!
EDIT:
I don't know if you can help me on this one, since I got some of the code from Snowballs to make it throwable, but I have one more error.
== ERRORS FOUND ==
src\minecraft\net\minecraft\\src\ItemBirthdaycake.java:29: :error: reached end of file while parsing
I made entity and render files since it is now throwable.
mod_Gag.java
package net.minecraft.src;
public class mod_Gag extends BaseMod
{
public static final Item Birthdaycake = new ItemBirthdaycake(5000).setItemName ("bdaycake");
public void load()
{
//Birthdaycake.iconIndex = ModLoader.addOverride("/gui/items.png", "/image.png");
ModLoader.addName(Birthdaycake, "Birthday Cake");
ModLoader.addRecipe(new ItemStack (Birthdaycake, 1), new Object [] {"#",
Character.valueOf('#'), Block.dirt});
}
public String getVersion()
{
return "1.2.5";
}
}
ItemBirthdaycake.java
public class ItemBirthdaycake extends Item
{
public ItemBirthdaycake(int i)
{
super(i);
maxStackSize = 64;
}
/**
* Called whenever this item is equipped and the right mouse button is pressed. Args: itemStack, world, entityPlayer
*/
public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer)
{
if (!par3EntityPlayer.capabilities.isCreativeMode)
{
par1ItemStack.stackSize--;
}
par2World.playSoundAtEntity(par3EntityPlayer, "random.bow", 0.5F, 0.4F / (itemRand.nextFloat() * 0.4F + 0.8F));
if (!par2World.isRemote)
{
par2World.spawnEntityInWorld(new EntityBirthdaycake(par2World, par3EntityPlayer));
}
return par1ItemStack;
}
EntityBirthdaycake.java
package net.minecraft.src;
public class EntityBirthdaycake extends EntityThrowable
{
public EntityBirthdaycake(World par1World)
{
super(par1World);
}
public EntityBirthdaycake(World par1World, EntityLiving par2EntityLiving)
{
super(par1World, par2EntityLiving);
}
public EntityBirthdaycake(World par1World, double par2, double par4, double par6)
{
super(par1World, par2, par4, par6);
}
/**
* Called when the throwable hits a block or entity.
*/
protected void onImpact(MovingObjectPosition par1MovingObjectPosition)
{
if (par1MovingObjectPosition.entityHit != null)
{
byte byte0 = 0;
if (par1MovingObjectPosition.entityHit instanceof EntityBlaze)
{
byte0 = 3;
}
if (!par1MovingObjectPosition.entityHit.attackEntityFrom(DamageSource.causeThrownDamage(this, thrower), byte0));
}
for (int i = 0; i < 8; i++)
{
worldObj.spawnParticle("snowballpoof", posX, posY, posZ, 0.0D, 0.0D, 0.0D);
}
if (!worldObj.isRemote)
{
setDead();
}
}
}
RenderBirthdaycake.java
package net.minecraft.src;
import org.lwjgl.opengl.GL11;
import org.lwjgl.opengl.GL12;
public class RenderBirthdaycake extends Render
{
/**
* Have the icon index (in items.png) that will be used to render the image. Currently, eggs and snowballs uses this
* classes.
*/
private int itemIconIndex;
public RenderBirthdaycake(int par1)
{
itemIconIndex = par1;
}
/**
* Actually renders the given argument. This is a synthetic bridge method, always casting down its argument and then
* handing it off to a worker function which does the actual work. In all probabilty, the class Render is generic
* (Render<T extends Entity) and this method has signature public void doRender(T entity, double d, double d1,
* double d2, float f, float f1). But JAD is pre 1.5 so doesn't do that.
*/
public void doRender(Entity par1Entity, double par2, double par4, double par6, float par8, float par9)
{
GL11.glPushMatrix();
GL11.glTranslatef((float)par2, (float)par4, (float)par6);
GL11.glEnable(GL12.GL_RESCALE_NORMAL);
GL11.glScalef(0.5F, 0.5F, 0.5F);
loadTexture("/gui/items.png");
Tessellator tessellator = Tessellator.instance;
if (itemIconIndex == 154)
{
int i = PotionHelper.func_40358_a(((EntityPotion)par1Entity).getPotionDamage(), false);
float f = (float)(i >> 16 & 0xff) / 255F;
float f1 = (float)(i >> 8 & 0xff) / 255F;
float f2 = (float)(i & 0xff) / 255F;
GL11.glColor3f(f, f1, f2);
GL11.glPushMatrix();
func_40265_a(tessellator, 141);
GL11.glPopMatrix();
GL11.glColor3f(1.0F, 1.0F, 1.0F);
}
func_40265_a(tessellator, itemIconIndex);
GL11.glDisable(GL12.GL_RESCALE_NORMAL);
GL11.glPopMatrix();
}
private void func_40265_a(Tessellator par1Tessellator, int par2)
{
float f = (float)((par2 % 16) * 16 + 0) / 256F;
float f1 = (float)((par2 % 16) * 16 + 16) / 256F;
float f2 = (float)((par2 / 16) * 16 + 0) / 256F;
float f3 = (float)((par2 / 16) * 16 + 16) / 256F;
float f4 = 1.0F;
float f5 = 0.5F;
float f6 = 0.25F;
GL11.glRotatef(180F - renderManager.playerViewY, 0.0F, 1.0F, 0.0F);
GL11.glRotatef(-renderManager.playerViewX, 1.0F, 0.0F, 0.0F);
par1Tessellator.startDrawingQuads();
par1Tessellator.setNormal(0.0F, 1.0F, 0.0F);
par1Tessellator.addVertexWithUV(0.0F - f5, 0.0F - f6, 0.0D, f, f3);
par1Tessellator.addVertexWithUV(f4 - f5, 0.0F - f6, 0.0D, f1, f3);
par1Tessellator.addVertexWithUV(f4 - f5, f4 - f6, 0.0D, f1, f2);
par1Tessellator.addVertexWithUV(0.0F - f5, f4 - f6, 0.0D, f, f2);
par1Tessellator.draw();
}
}
EDIT:
I don't know if you can help me on this one, since I got some of the code from Snowballs to make it throwable, but I have one more error.
== ERRORS FOUND ==
src\minecraft\net\minecraft\\src\ItemBirthdaycake.java:29: :error: reached end of file while parsing
I made entity and render files since it is now throwable.
mod_Gag.java
package net.minecraft.src;
public class mod_Gag extends BaseMod
{
public static final Item Birthdaycake = new ItemBirthdaycake(5000).setItemName ("bdaycake");
public void load()
{
//Birthdaycake.iconIndex = ModLoader.addOverride("/gui/items.png", "/image.png");
ModLoader.addName(Birthdaycake, "Birthday Cake");
ModLoader.addRecipe(new ItemStack (Birthdaycake, 1), new Object [] {"#",
Character.valueOf('#'), Block.dirt});
}
public String getVersion()
{
return "1.2.5";
}
}
ItemBirthdaycake.java
public class ItemBirthdaycake extends Item
{
public ItemBirthdaycake(int i)
{
super(i);
maxStackSize = 64;
}
/**
* Called whenever this item is equipped and the right mouse button is pressed. Args: itemStack, world, entityPlayer
*/
public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer)
{
if (!par3EntityPlayer.capabilities.isCreativeMode)
{
par1ItemStack.stackSize--;
}
par2World.playSoundAtEntity(par3EntityPlayer, "random.bow", 0.5F, 0.4F / (itemRand.nextFloat() * 0.4F + 0.8F));
if (!par2World.isRemote)
{
par2World.spawnEntityInWorld(new EntityBirthdaycake(par2World, par3EntityPlayer));
}
return par1ItemStack;
}
EntityBirthdaycake.java
package net.minecraft.src;
public class EntityBirthdaycake extends EntityThrowable
{
public EntityBirthdaycake(World par1World)
{
super(par1World);
}
public EntityBirthdaycake(World par1World, EntityLiving par2EntityLiving)
{
super(par1World, par2EntityLiving);
}
public EntityBirthdaycake(World par1World, double par2, double par4, double par6)
{
super(par1World, par2, par4, par6);
}
/**
* Called when the throwable hits a block or entity.
*/
protected void onImpact(MovingObjectPosition par1MovingObjectPosition)
{
if (par1MovingObjectPosition.entityHit != null)
{
byte byte0 = 0;
if (par1MovingObjectPosition.entityHit instanceof EntityBlaze)
{
byte0 = 3;
}
if (!par1MovingObjectPosition.entityHit.attackEntityFrom(DamageSource.causeThrownDamage(this, thrower), byte0));
}
for (int i = 0; i < 8; i++)
{
worldObj.spawnParticle("snowballpoof", posX, posY, posZ, 0.0D, 0.0D, 0.0D);
}
if (!worldObj.isRemote)
{
setDead();
}
}
}
RenderBirthdaycake.java
package net.minecraft.src;
import org.lwjgl.opengl.GL11;
import org.lwjgl.opengl.GL12;
public class RenderBirthdaycake extends Render
{
/**
* Have the icon index (in items.png) that will be used to render the image. Currently, eggs and snowballs uses this
* classes.
*/
private int itemIconIndex;
public RenderBirthdaycake(int par1)
{
itemIconIndex = par1;
}
/**
* Actually renders the given argument. This is a synthetic bridge method, always casting down its argument and then
* handing it off to a worker function which does the actual work. In all probabilty, the class Render is generic
* (Render<T extends Entity) and this method has signature public void doRender(T entity, double d, double d1,
* double d2, float f, float f1). But JAD is pre 1.5 so doesn't do that.
*/
public void doRender(Entity par1Entity, double par2, double par4, double par6, float par8, float par9)
{
GL11.glPushMatrix();
GL11.glTranslatef((float)par2, (float)par4, (float)par6);
GL11.glEnable(GL12.GL_RESCALE_NORMAL);
GL11.glScalef(0.5F, 0.5F, 0.5F);
loadTexture("/gui/items.png");
Tessellator tessellator = Tessellator.instance;
if (itemIconIndex == 154)
{
int i = PotionHelper.func_40358_a(((EntityPotion)par1Entity).getPotionDamage(), false);
float f = (float)(i >> 16 & 0xff) / 255F;
float f1 = (float)(i >> 8 & 0xff) / 255F;
float f2 = (float)(i & 0xff) / 255F;
GL11.glColor3f(f, f1, f2);
GL11.glPushMatrix();
func_40265_a(tessellator, 141);
GL11.glPopMatrix();
GL11.glColor3f(1.0F, 1.0F, 1.0F);
}
func_40265_a(tessellator, itemIconIndex);
GL11.glDisable(GL12.GL_RESCALE_NORMAL);
GL11.glPopMatrix();
}
private void func_40265_a(Tessellator par1Tessellator, int par2)
{
float f = (float)((par2 % 16) * 16 + 0) / 256F;
float f1 = (float)((par2 % 16) * 16 + 16) / 256F;
float f2 = (float)((par2 / 16) * 16 + 0) / 256F;
float f3 = (float)((par2 / 16) * 16 + 16) / 256F;
float f4 = 1.0F;
float f5 = 0.5F;
float f6 = 0.25F;
GL11.glRotatef(180F - renderManager.playerViewY, 0.0F, 1.0F, 0.0F);
GL11.glRotatef(-renderManager.playerViewX, 1.0F, 0.0F, 0.0F);
par1Tessellator.startDrawingQuads();
par1Tessellator.setNormal(0.0F, 1.0F, 0.0F);
par1Tessellator.addVertexWithUV(0.0F - f5, 0.0F - f6, 0.0D, f, f3);
par1Tessellator.addVertexWithUV(f4 - f5, 0.0F - f6, 0.0D, f1, f3);
par1Tessellator.addVertexWithUV(f4 - f5, f4 - f6, 0.0D, f1, f2);
par1Tessellator.addVertexWithUV(0.0F - f5, f4 - f6, 0.0D, f, f2);
par1Tessellator.draw();
}
}
You have unclosed brackets somewhere in your ItemBirthdaycake class. Check and double check all of them, particularly curly braces. { }
Rollback Post to RevisionRollBack
“Computers are incredibly fast, accurate and stupid; humans are incredibly slow, inaccurate and brilliant; together they are powerful beyond imagination."
hey techguy, i am trying to make a panda, i've almost finished, finally got minecraft to run in eclipse, but now the texture is glitching. it loads a few parts here and there but it is mostly invisible! that is not how i made my texture. i did exactly what you said to in the custom mob tutorial and eclipse texture tutorial. whenever i try moving the texture to a different place it loads a white mob that says on it "texture not found." please help! (i would upload a image and the code but my modding computer is really slow and i don't know if i can save snapshots when testing it with the eclipse run button.)
Alright it's working now thanks!
EDIT:
I don't know if you can help me on this one, since I got some of the code from Snowballs to make it throwable, but I have one more error.
== ERRORS FOUND ==
src\minecraft\net\minecraft\\src\ItemBirthdaycake.java:29: :error: reached end of file while parsing
I made entity and render files since it is now throwable.
mod_Gag.java
package net.minecraft.src;
public class mod_Gag extends BaseMod
{
public static final Item Birthdaycake = new ItemBirthdaycake(5000).setItemName ("bdaycake");
public void load()
{
//Birthdaycake.iconIndex = ModLoader.addOverride("/gui/items.png", "/image.png");
ModLoader.addName(Birthdaycake, "Birthday Cake");
ModLoader.addRecipe(new ItemStack (Birthdaycake, 1), new Object [] {"#",
Character.valueOf('#'), Block.dirt});
}
public String getVersion()
{
return "1.2.5";
}
}
ItemBirthdaycake.java
public class ItemBirthdaycake extends Item
{
public ItemBirthdaycake(int i)
{
super(i);
maxStackSize = 64;
}
/**
* Called whenever this item is equipped and the right mouse button is pressed. Args: itemStack, world, entityPlayer
*/
public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer)
{
if (!par3EntityPlayer.capabilities.isCreativeMode)
{
par1ItemStack.stackSize--;
}
par2World.playSoundAtEntity(par3EntityPlayer, "random.bow", 0.5F, 0.4F / (itemRand.nextFloat() * 0.4F + 0.8F));
if (!par2World.isRemote)
{
par2World.spawnEntityInWorld(new EntityBirthdaycake(par2World, par3EntityPlayer));
}
return par1ItemStack;
}
EntityBirthdaycake.java
package net.minecraft.src;
public class EntityBirthdaycake extends EntityThrowable
{
public EntityBirthdaycake(World par1World)
{
super(par1World);
}
public EntityBirthdaycake(World par1World, EntityLiving par2EntityLiving)
{
super(par1World, par2EntityLiving);
}
public EntityBirthdaycake(World par1World, double par2, double par4, double par6)
{
super(par1World, par2, par4, par6);
}
/**
* Called when the throwable hits a block or entity.
*/
protected void onImpact(MovingObjectPosition par1MovingObjectPosition)
{
if (par1MovingObjectPosition.entityHit != null)
{
byte byte0 = 0;
if (par1MovingObjectPosition.entityHit instanceof EntityBlaze)
{
byte0 = 3;
}
if (!par1MovingObjectPosition.entityHit.attackEntityFrom(DamageSource.causeThrownDamage(this, thrower), byte0));
}
for (int i = 0; i < 8; i++)
{
worldObj.spawnParticle("snowballpoof", posX, posY, posZ, 0.0D, 0.0D, 0.0D);
}
if (!worldObj.isRemote)
{
setDead();
}
}
}
RenderBirthdaycake.java
package net.minecraft.src;
import org.lwjgl.opengl.GL11;
import org.lwjgl.opengl.GL12;
public class RenderBirthdaycake extends Render
{
/**
* Have the icon index (in items.png) that will be used to render the image. Currently, eggs and snowballs uses this
* classes.
*/
private int itemIconIndex;
public RenderBirthdaycake(int par1)
{
itemIconIndex = par1;
}
/**
* Actually renders the given argument. This is a synthetic bridge method, always casting down its argument and then
* handing it off to a worker function which does the actual work. In all probabilty, the class Render is generic
* (Render<T extends Entity) and this method has signature public void doRender(T entity, double d, double d1,
* double d2, float f, float f1). But JAD is pre 1.5 so doesn't do that.
*/
public void doRender(Entity par1Entity, double par2, double par4, double par6, float par8, float par9)
{
GL11.glPushMatrix();
GL11.glTranslatef((float)par2, (float)par4, (float)par6);
GL11.glEnable(GL12.GL_RESCALE_NORMAL);
GL11.glScalef(0.5F, 0.5F, 0.5F);
loadTexture("/gui/items.png");
Tessellator tessellator = Tessellator.instance;
if (itemIconIndex == 154)
{
int i = PotionHelper.func_40358_a(((EntityPotion)par1Entity).getPotionDamage(), false);
float f = (float)(i >> 16 & 0xff) / 255F;
float f1 = (float)(i >> 8 & 0xff) / 255F;
float f2 = (float)(i & 0xff) / 255F;
GL11.glColor3f(f, f1, f2);
GL11.glPushMatrix();
func_40265_a(tessellator, 141);
GL11.glPopMatrix();
GL11.glColor3f(1.0F, 1.0F, 1.0F);
}
func_40265_a(tessellator, itemIconIndex);
GL11.glDisable(GL12.GL_RESCALE_NORMAL);
GL11.glPopMatrix();
}
private void func_40265_a(Tessellator par1Tessellator, int par2)
{
float f = (float)((par2 % 16) * 16 + 0) / 256F;
float f1 = (float)((par2 % 16) * 16 + 16) / 256F;
float f2 = (float)((par2 / 16) * 16 + 0) / 256F;
float f3 = (float)((par2 / 16) * 16 + 16) / 256F;
float f4 = 1.0F;
float f5 = 0.5F;
float f6 = 0.25F;
GL11.glRotatef(180F - renderManager.playerViewY, 0.0F, 1.0F, 0.0F);
GL11.glRotatef(-renderManager.playerViewX, 1.0F, 0.0F, 0.0F);
par1Tessellator.startDrawingQuads();
par1Tessellator.setNormal(0.0F, 1.0F, 0.0F);
par1Tessellator.addVertexWithUV(0.0F - f5, 0.0F - f6, 0.0D, f, f3);
par1Tessellator.addVertexWithUV(f4 - f5, 0.0F - f6, 0.0D, f1, f3);
par1Tessellator.addVertexWithUV(f4 - f5, f4 - f6, 0.0D, f1, f2);
par1Tessellator.addVertexWithUV(0.0F - f5, f4 - f6, 0.0D, f, f2);
par1Tessellator.draw();
}
}
Ahh, I see. You were going to give the cake special properties. no wonder you didn't delete it when I said to. My bad.
Alright it's working now thanks!
EDIT:
I don't know if you can help me on this one, since I got some of the code from Snowballs to make it throwable, but I have one more error.
== ERRORS FOUND ==
src\minecraft\net\minecraft\\src\ItemBirthdaycake.java:29: :error: reached end of file while parsing
I made entity and render files since it is now throwable.
mod_Gag.java
package net.minecraft.src;
public class mod_Gag extends BaseMod
{
public static final Item Birthdaycake = new ItemBirthdaycake(5000).setItemName ("bdaycake");
public void load()
{
//Birthdaycake.iconIndex = ModLoader.addOverride("/gui/items.png", "/image.png");
ModLoader.addName(Birthdaycake, "Birthday Cake");
ModLoader.addRecipe(new ItemStack (Birthdaycake, 1), new Object [] {"#",
Character.valueOf('#'), Block.dirt});
}
public String getVersion()
{
return "1.2.5";
}
}
ItemBirthdaycake.java
public class ItemBirthdaycake extends Item
{
public ItemBirthdaycake(int i)
{
super(i);
maxStackSize = 64;
}
/**
* Called whenever this item is equipped and the right mouse button is pressed. Args: itemStack, world, entityPlayer
*/
public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer)
{
if (!par3EntityPlayer.capabilities.isCreativeMode)
{
par1ItemStack.stackSize--;
}
par2World.playSoundAtEntity(par3EntityPlayer, "random.bow", 0.5F, 0.4F / (itemRand.nextFloat() * 0.4F + 0.8F));
if (!par2World.isRemote)
{
par2World.spawnEntityInWorld(new EntityBirthdaycake(par2World, par3EntityPlayer));
}
return par1ItemStack;
}
EntityBirthdaycake.java
package net.minecraft.src;
public class EntityBirthdaycake extends EntityThrowable
{
public EntityBirthdaycake(World par1World)
{
super(par1World);
}
public EntityBirthdaycake(World par1World, EntityLiving par2EntityLiving)
{
super(par1World, par2EntityLiving);
}
public EntityBirthdaycake(World par1World, double par2, double par4, double par6)
{
super(par1World, par2, par4, par6);
}
/**
* Called when the throwable hits a block or entity.
*/
protected void onImpact(MovingObjectPosition par1MovingObjectPosition)
{
if (par1MovingObjectPosition.entityHit != null)
{
byte byte0 = 0;
if (par1MovingObjectPosition.entityHit instanceof EntityBlaze)
{
byte0 = 3;
}
if (!par1MovingObjectPosition.entityHit.attackEntityFrom(DamageSource.causeThrownDamage(this, thrower), byte0));
}
for (int i = 0; i < 8; i++)
{
worldObj.spawnParticle("snowballpoof", posX, posY, posZ, 0.0D, 0.0D, 0.0D);
}
if (!worldObj.isRemote)
{
setDead();
}
}
}
RenderBirthdaycake.java
package net.minecraft.src;
import org.lwjgl.opengl.GL11;
import org.lwjgl.opengl.GL12;
public class RenderBirthdaycake extends Render
{
/**
* Have the icon index (in items.png) that will be used to render the image. Currently, eggs and snowballs uses this
* classes.
*/
private int itemIconIndex;
public RenderBirthdaycake(int par1)
{
itemIconIndex = par1;
}
/**
* Actually renders the given argument. This is a synthetic bridge method, always casting down its argument and then
* handing it off to a worker function which does the actual work. In all probabilty, the class Render is generic
* (Render<T extends Entity) and this method has signature public void doRender(T entity, double d, double d1,
* double d2, float f, float f1). But JAD is pre 1.5 so doesn't do that.
*/
public void doRender(Entity par1Entity, double par2, double par4, double par6, float par8, float par9)
{
GL11.glPushMatrix();
GL11.glTranslatef((float)par2, (float)par4, (float)par6);
GL11.glEnable(GL12.GL_RESCALE_NORMAL);
GL11.glScalef(0.5F, 0.5F, 0.5F);
loadTexture("/gui/items.png");
Tessellator tessellator = Tessellator.instance;
if (itemIconIndex == 154)
{
int i = PotionHelper.func_40358_a(((EntityPotion)par1Entity).getPotionDamage(), false);
float f = (float)(i >> 16 & 0xff) / 255F;
float f1 = (float)(i >> 8 & 0xff) / 255F;
float f2 = (float)(i & 0xff) / 255F;
GL11.glColor3f(f, f1, f2);
GL11.glPushMatrix();
func_40265_a(tessellator, 141);
GL11.glPopMatrix();
GL11.glColor3f(1.0F, 1.0F, 1.0F);
}
func_40265_a(tessellator, itemIconIndex);
GL11.glDisable(GL12.GL_RESCALE_NORMAL);
GL11.glPopMatrix();
}
private void func_40265_a(Tessellator par1Tessellator, int par2)
{
float f = (float)((par2 % 16) * 16 + 0) / 256F;
float f1 = (float)((par2 % 16) * 16 + 16) / 256F;
float f2 = (float)((par2 / 16) * 16 + 0) / 256F;
float f3 = (float)((par2 / 16) * 16 + 16) / 256F;
float f4 = 1.0F;
float f5 = 0.5F;
float f6 = 0.25F;
GL11.glRotatef(180F - renderManager.playerViewY, 0.0F, 1.0F, 0.0F);
GL11.glRotatef(-renderManager.playerViewX, 1.0F, 0.0F, 0.0F);
par1Tessellator.startDrawingQuads();
par1Tessellator.setNormal(0.0F, 1.0F, 0.0F);
par1Tessellator.addVertexWithUV(0.0F - f5, 0.0F - f6, 0.0D, f, f3);
par1Tessellator.addVertexWithUV(f4 - f5, 0.0F - f6, 0.0D, f1, f3);
par1Tessellator.addVertexWithUV(f4 - f5, f4 - f6, 0.0D, f1, f2);
par1Tessellator.addVertexWithUV(0.0F - f5, f4 - f6, 0.0D, f, f2);
par1Tessellator.draw();
}
}
public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer)
{
that never got closed off!
close it off right before the last bracket!
hey techguy, i am trying to make a panda, i've almost finished, finally got minecraft to run in eclipse, but now the texture is glitching. it loads a few parts here and there but it is mostly invisible! that is not how i made my texture. i did exactly what you said to in the custom mob tutorial and eclipse texture tutorial. whenever i try moving the texture to a different place it loads a white mob that says on it "texture not found." please help! (i would upload a image and the code but my modding computer is really slow and i don't know if i can save snapshots when testing it with the eclipse run button.)
Post your code.
Rollback Post to RevisionRollBack
“Computers are incredibly fast, accurate and stupid; humans are incredibly slow, inaccurate and brilliant; together they are powerful beyond imagination."
Oh crap...Well, considering all slots below 127 are taken, that will not work
Please help
-
View User Profile
-
View Posts
-
Send Message
Retired StaffDid you delete the ItemBirthdaycake class? If not, you should have. If you did, then you just forgot to change new ItemBirthdaycake(5000, 0) to new Item(5000, 0).
Items can only have one parameter. Remove the 0 in this part.
together they are powerful beyond imagination."
Forge fixes this issue. I am using it and have a biome with blocks which have ids over this limit.
I recommend using these tutorials. You just make your model in Techne (or just code it if you want to) then export it and follow the tutorial.
The tutorial explains skins.
together they are powerful beyond imagination."
Post your code.
together they are powerful beyond imagination."
to
together they are powerful beyond imagination."
Alright it's working now thanks!
EDIT:
I don't know if you can help me on this one, since I got some of the code from Snowballs to make it throwable, but I have one more error.
== ERRORS FOUND ==
src\minecraft\net\minecraft\\src\ItemBirthdaycake.java:29: :error: reached end of file while parsing
I made entity and render files since it is now throwable.
mod_Gag.java
package net.minecraft.src; public class mod_Gag extends BaseMod { public static final Item Birthdaycake = new ItemBirthdaycake(5000).setItemName ("bdaycake"); public void load() { //Birthdaycake.iconIndex = ModLoader.addOverride("/gui/items.png", "/image.png"); ModLoader.addName(Birthdaycake, "Birthday Cake"); ModLoader.addRecipe(new ItemStack (Birthdaycake, 1), new Object [] {"#", Character.valueOf('#'), Block.dirt}); } public String getVersion() { return "1.2.5"; } }ItemBirthdaycake.java
public class ItemBirthdaycake extends Item { public ItemBirthdaycake(int i) { super(i); maxStackSize = 64; } /** * Called whenever this item is equipped and the right mouse button is pressed. Args: itemStack, world, entityPlayer */ public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) { if (!par3EntityPlayer.capabilities.isCreativeMode) { par1ItemStack.stackSize--; } par2World.playSoundAtEntity(par3EntityPlayer, "random.bow", 0.5F, 0.4F / (itemRand.nextFloat() * 0.4F + 0.8F)); if (!par2World.isRemote) { par2World.spawnEntityInWorld(new EntityBirthdaycake(par2World, par3EntityPlayer)); } return par1ItemStack; }EntityBirthdaycake.java
package net.minecraft.src; public class EntityBirthdaycake extends EntityThrowable { public EntityBirthdaycake(World par1World) { super(par1World); } public EntityBirthdaycake(World par1World, EntityLiving par2EntityLiving) { super(par1World, par2EntityLiving); } public EntityBirthdaycake(World par1World, double par2, double par4, double par6) { super(par1World, par2, par4, par6); } /** * Called when the throwable hits a block or entity. */ protected void onImpact(MovingObjectPosition par1MovingObjectPosition) { if (par1MovingObjectPosition.entityHit != null) { byte byte0 = 0; if (par1MovingObjectPosition.entityHit instanceof EntityBlaze) { byte0 = 3; } if (!par1MovingObjectPosition.entityHit.attackEntityFrom(DamageSource.causeThrownDamage(this, thrower), byte0)); } for (int i = 0; i < 8; i++) { worldObj.spawnParticle("snowballpoof", posX, posY, posZ, 0.0D, 0.0D, 0.0D); } if (!worldObj.isRemote) { setDead(); } } }RenderBirthdaycake.java
package net.minecraft.src; import org.lwjgl.opengl.GL11; import org.lwjgl.opengl.GL12; public class RenderBirthdaycake extends Render { /** * Have the icon index (in items.png) that will be used to render the image. Currently, eggs and snowballs uses this * classes. */ private int itemIconIndex; public RenderBirthdaycake(int par1) { itemIconIndex = par1; } /** * Actually renders the given argument. This is a synthetic bridge method, always casting down its argument and then * handing it off to a worker function which does the actual work. In all probabilty, the class Render is generic * (Render<T extends Entity) and this method has signature public void doRender(T entity, double d, double d1, * double d2, float f, float f1). But JAD is pre 1.5 so doesn't do that. */ public void doRender(Entity par1Entity, double par2, double par4, double par6, float par8, float par9) { GL11.glPushMatrix(); GL11.glTranslatef((float)par2, (float)par4, (float)par6); GL11.glEnable(GL12.GL_RESCALE_NORMAL); GL11.glScalef(0.5F, 0.5F, 0.5F); loadTexture("/gui/items.png"); Tessellator tessellator = Tessellator.instance; if (itemIconIndex == 154) { int i = PotionHelper.func_40358_a(((EntityPotion)par1Entity).getPotionDamage(), false); float f = (float)(i >> 16 & 0xff) / 255F; float f1 = (float)(i >> 8 & 0xff) / 255F; float f2 = (float)(i & 0xff) / 255F; GL11.glColor3f(f, f1, f2); GL11.glPushMatrix(); func_40265_a(tessellator, 141); GL11.glPopMatrix(); GL11.glColor3f(1.0F, 1.0F, 1.0F); } func_40265_a(tessellator, itemIconIndex); GL11.glDisable(GL12.GL_RESCALE_NORMAL); GL11.glPopMatrix(); } private void func_40265_a(Tessellator par1Tessellator, int par2) { float f = (float)((par2 % 16) * 16 + 0) / 256F; float f1 = (float)((par2 % 16) * 16 + 16) / 256F; float f2 = (float)((par2 / 16) * 16 + 0) / 256F; float f3 = (float)((par2 / 16) * 16 + 16) / 256F; float f4 = 1.0F; float f5 = 0.5F; float f6 = 0.25F; GL11.glRotatef(180F - renderManager.playerViewY, 0.0F, 1.0F, 0.0F); GL11.glRotatef(-renderManager.playerViewX, 1.0F, 0.0F, 0.0F); par1Tessellator.startDrawingQuads(); par1Tessellator.setNormal(0.0F, 1.0F, 0.0F); par1Tessellator.addVertexWithUV(0.0F - f5, 0.0F - f6, 0.0D, f, f3); par1Tessellator.addVertexWithUV(f4 - f5, 0.0F - f6, 0.0D, f1, f3); par1Tessellator.addVertexWithUV(f4 - f5, f4 - f6, 0.0D, f1, f2); par1Tessellator.addVertexWithUV(0.0F - f5, f4 - f6, 0.0D, f, f2); par1Tessellator.draw(); } }You have unclosed brackets somewhere in your ItemBirthdaycake class. Check and double check all of them, particularly curly braces. { }
together they are powerful beyond imagination."
1.Where is it the code to make the entity walk towards you?
2.How do you make it go away from you?
P.S.
thanks for your tutorials
(repeated the post to bring it to your attention)
-
View User Profile
-
View Posts
-
Send Message
Retired StaffAhh, I see. You were going to give the cake special properties. no wonder you didn't delete it when I said to. My bad.
public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) {that never got closed off!
close it off right before the last bracket!
Changing it to ModelBiped didn't work, I still have the same problem. Any other suggestions?
--CNSoup
package net.minecraft.src; import java.util.List; import net.minecraft.client.Minecraft; public class mod_newfood extends BaseMod { private static GuiScreen creativeInventory; public static final Item GoldenApple = new ItemFood(4500,4,1F,false).setPotionEffect(Potion.regeneration.id,60,0,1F).setItemName("Golden Apple"); public void load() { ModLoader.setInGameHook(this,true,false); ModLoader.setInGUIHook(this,true,false); ModLoader.addName(GoldenApple,"Golden Apple"); ModLoader.addRecipe(new ItemStack(GoldenApple,1),new Object[]{"@@@","@#@","@@@",Character.valueOf([email="'@'),Item.ingotGold,Character.valueOf('#'),Item.appleRed"]'@'),Item.ingotGold,Character.valueOf('#'),Item.appleRed[/email]}); } public boolean onTickInGUI(float f,Minecraft minecraft,GuiScreen guiscreen) { if((guiscreen instanceof GuiContainerCreative)&& !(creativeInventory instanceof GuiContainerCreative)&& !minecraft.theWorld.isRemote) { Container container = ((GuiContainer)guiscreen).inventorySlots; List list = ((ContainerCreative)container).itemList; int i = 0; list.add(new ItemStack(GoldenApple,1)); } creativeInventory = guiscreen; return true; } public String getVersion() { return "v1.0"; } }Post your code.
together they are powerful beyond imagination."
I have now idea why but this is what it looks like in Eclipse:
Please help.