1

Little bit of help

ThatRandomGuy296's Avatar ThatRandomGuy2966/7/13 9:31 pm
1 emeralds 404 9
6/8/2013 4:21 pm
ThatRandomGuy296's Avatar ThatRandomGuy296
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!
Posted by ThatRandomGuy296's Avatar
ThatRandomGuy296
Level 12 : Journeyman Engineer
2

Create an account or sign in to comment.

9

ThatRandomGuy296
06/08/2013 4:21 pm
Level 12 : Journeyman Engineer
ThatRandomGuy296's Avatar
Cool will do
1
froghog
06/08/2013 3:45 pm
Level 63 : High Grandmaster Modder
froghog's Avatar
you can pm me at any time if you have any more questions/ need more help!
1
froghog
06/08/2013 12:49 pm
Level 63 : High Grandmaster Modder
froghog's Avatar
oh, yeah that is what i meant. mod_. you are welcome
1
ThatRandomGuy296
06/08/2013 7:17 am
Level 12 : Journeyman Engineer
ThatRandomGuy296's Avatar
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?
1
froghog
06/08/2013 1:02 am
Level 63 : High Grandmaster Modder
froghog's Avatar
why thank you! i really hope that i helped!
1
eminemfan33
06/07/2013 11:24 pm
Level 11 : Journeyman Miner
eminemfan33's Avatar
*chicken
1
Instant_ReplEH
06/07/2013 11:20 pm
Level 31 : Artisan Fisherman
Instant_ReplEH's Avatar
Mr.FrogHog you seem quite smart
1
froghog
06/07/2013 11:11 pm
Level 63 : High Grandmaster Modder
froghog's Avatar
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
Click to reveal
package net.minecraft.src;

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");


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;
}
}

(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
1
Noobington9001
06/07/2013 10:39 pm
Level 1 : New Crafter
Noobington9001's Avatar
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
1
Planet Minecraft

Website

© 2010 - 2024
www.planetminecraft.com

Welcome