Jump to content

Recommended Posts

Posted

I have several questions about how to use Forge:

1. How do I acess the Ore Dictionary to add my ores to it?

2. I need to make a tool somewhat like the RedPower handsaw in that it takes damage when used in the crafting of various items.

3. How do I make a block have a thin profile like the EE trans tablet?

4. How do I make said block above have an inventory (like a chest)?

Thanks in advance to anyone who helps!

So, what would happen if I did push that shiny red button over there? ... Really? ... Can I try it? ... Damn.

Posted

I have several questions about how to use Forge:

1. How do I acess the Ore Dictionary to add my ores to it?

Look in ForgeHooks.java (I think it was called).  And considering all the requests lately, a tutorial might pop up soon.

 

2. I need to make a tool somewhat like the RedPower handsaw in that it takes damage when used in the crafting of various items.

Unsure about this, wait for another to answer, I have not yet made an item that needs this.

 

 

3. How do I make a block have a thin profile like the EE trans tablet?

That is vanilla Block stuff.  Look at the methods about the collision size and so forth.  For the visible part, look at shorter Block rendering, like the half-slab.

 

 

4. How do I make said block above have an inventory (like a chest)?

 

Look at the chest java files, it is the de-facto example for that, basically a copy and change.  :)

Posted

They are very, very, confusing. Can you explain it?

So, what would happen if I did push that shiny red button over there? ... Really? ... Can I try it? ... Damn.

Posted

I do know... Guess I just have to spend another hour in front of the tube...  xD

I also don't really get what file does what:

GuiChest: Does the GUI (duh)

TileEntityChest: ?

BlockChest: Textures and stuff

InventoryChest: The stuff in the inventory

Please correct me if I'm wrong.

So, what would happen if I did push that shiny red button over there? ... Really? ... Can I try it? ... Damn.

Posted

To be honest you don't really need java experience to make mods but it helps a lot. Also be best if you go to minecraft forum's modding section and read some of the tutorials. but i'll answer some questions really quick. TileEntity is an entity that acts in the same space as a block, its mainly used to do simple tasks and save data to the block location.

 

as for you question #2 what you need to do is make a crafting recipe that will get the items current damage, outputs the item  with 1 less use, and  leave it in the crafting window. I actual don't have or know the code for this but if you search the minecraft code, parts of it will be there. If you need code for something else just think what already does this and go find it's code.

Posted

To be honest you don't really need java experience to make mods but it helps a lot. Also be best if you go to minecraft forum's modding section and read some of the tutorials. but i'll answer some questions really quick. TileEntity is an entity that acts in the same space as a block, its mainly used to do simple tasks and save data to the block location.

 

as for you question #2 what you need to do is make a crafting recipe that will get the items current damage, outputs the item  with 1 less use, and  leave it in the crafting window. I actual don't have or know the code for this but if you search the minecraft code, parts of it will be there. If you need code for something else just think what already does this and go find it's code.

Thanks! Do you know of any open source mods that do these kinds of things?

So, what would happen if I did push that shiny red button over there? ... Really? ... Can I try it? ... Damn.

Posted

For your item that gets damaged when using it in a crafting recipe, you could use this in your item file:

 

public void onCreated(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer)
{
     mod_****.ItemBeingDamaged.damageItem(how many uses, par3EntityPlayer);
}

 

Not 100% sure if it will work since I didn't test the code before giving it to you but it seems like it would work.

 

Edit: Nevermind, this won't work since the item will be used up in the recipe. Doh!

 

But, still using the onCreate method, you COULD instantiate a private variable that keeps track of the ItemBeingDamaged current damage, and when the new item is created, give the player a 'new' ItemBeingDamaged, then call damageItem(current damage + amount, par3EntityPlayer); on the 'new' ItemBeingDamaged ItemStack

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.