1
Little bit of help
Hello, I want to make a mod that changed the color of eggs laid by ducks and what they do when thrown. And I need to know how would I change it for my mod. Would I have to write my own new code? If so, how would I make override the old one? If not, where would I go to find the old code?
I'm using ModLoader and just need this last piece of information.
Thank You!
I'm using ModLoader and just need this last piece of information.
Thank You!
Create an account or sign in to comment.
9
Cool will do
you can pm me at any time if you have any more questions/ need more help!
oh, yeah that is what i meant. mod_. you are welcome
Omg you helped A LOT! You explained it perfectly. I already had MCP and eclipse just needed to really know how to approach the egg coding because the tutorials I was following only had make new items not edit old ones. Thank you so much!
One small question: you put moc_file did ou mean mod_file?
One small question: you put moc_file did ou mean mod_file?
why thank you! i really hope that i helped!
*chicken
Mr.FrogHog you seem quite smart
GET MCP AND ECLIPSE!!! learn how to use it to mod.
first, you need to figure out the basics of modding if you dont. yes, you do have to write your own code. for starters, you need to make the mod_file. remember: lowercase m in the mod_file. this is the basic format for modloader
so, say that you would like to create a red chicken egg. this would be what you place in the mod_file after the basemod{ and before the public void load.
you would write something like this.
you WILL get errors at first, but just continue.
next, you need to create the ItemChickenred file
this is where you will be able to modify what it does and whether or not you can throw it.
it will look like this in it's basic stages.
(this is the egg file modded)
next you need to put this within the public void load brackets in the mod_file.
Lastly, go into the EntityChicken file. it should be pretty easy to find where it says :
this.dropItem(Item.egg.itemID, 1);
this should be at around line 83 or so. just put this in after in a different line:
this.dropItem(mod_"your mod_file".Chickenred.itemID, 1);
i really hope that this helps, and i also hope that you are able to understand how i have explained it.
feel free to ask any questions
first, you need to figure out the basics of modding if you dont. yes, you do have to write your own code. for starters, you need to make the mod_file. remember: lowercase m in the mod_file. this is the basic format for modloader
Click to reveal
package net.minecraft.src;
public class mod_"your mod name" extends BaseMod{
public void load(){
}
public String getVersion(){
return null;
}
}
public class mod_"your mod name" extends BaseMod{
public void load(){
}
public String getVersion(){
return null;
}
}
so, say that you would like to create a red chicken egg. this would be what you place in the mod_file after the basemod{ and before the public void load.
you would write something like this.
Click to reveal
public static final Item Chickenred = new ItemChickenred(179)
.setCreativeTab(CreativeTabs.tabMisc)
.setUnlocalizedName("Chickenred");
.setCreativeTab(CreativeTabs.tabMisc)
.setUnlocalizedName("Chickenred");
you WILL get errors at first, but just continue.
next, you need to create the ItemChickenred file
this is where you will be able to modify what it does and whether or not you can throw it.
it will look like this in it's basic stages.
Click to reveal
package net.minecraft.src;
public class ItemChickenred extends Item
{
public ItemChickenred(int par1)
{
super(par1);
this.maxStackSize = 16;
this.setCreativeTab(CreativeTabs.tabMaterials);
}
/**
* 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 EntityEgg(par2World, par3EntityPlayer));
}
return par1ItemStack;
}
}
public class ItemChickenred extends Item
{
public ItemChickenred(int par1)
{
super(par1);
this.maxStackSize = 16;
this.setCreativeTab(CreativeTabs.tabMaterials);
}
/**
* 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 EntityEgg(par2World, par3EntityPlayer));
}
return par1ItemStack;
}
}
(this is the egg file modded)
next you need to put this within the public void load brackets in the mod_file.
Click to reveal
ModLoader.addName(Chikenred, "Red Egg");
Lastly, go into the EntityChicken file. it should be pretty easy to find where it says :
this.dropItem(Item.egg.itemID, 1);
this should be at around line 83 or so. just put this in after in a different line:
this.dropItem(mod_"your mod_file".Chickenred.itemID, 1);
i really hope that this helps, and i also hope that you are able to understand how i have explained it.
feel free to ask any questions
You would have to make your own code for the different kinds of eggs and their effects. I don't know squat about coding but I knew that