Jump to content

[1.7.10] How to code a smelting recipe with a waterbucket


H4rros

Recommended Posts

Hi everyone,

I'm writing on my first mod and i want to make smelting recipe that uses a waterbucket.

I want to make salt out of water and my problem is i can't figure out how i can how i can get an empty bucket back when the melting is finished.

I put the waterbucket into the furnace and as soon as the melting is finished i get the salt but the bucket is gone.

I have a crafting recipe and there it works.

 

I hope anybody of you can help me

 

Link to comment
Share on other sites

that or make your salt have sub items, and one of them is "bucket of salt" which has an onUpdate function that when it's in a player's inventory will turn into salt, and give an empty bucket.

 

So smelt water bucket -> salt bucket -> salt + bucket

 

salt is damage value of 0

salt bucket is damage value of 1

 

onUpdate()

if (itemstack.getitemDamage == 1)

{

consume salt bucket, add salt, and add bucket

}

 

EDIT:

Thinking about it now, no need to consume the salt bucket, just set it's damage to 0, which is salt.

so

if (itemstack.getItemDamage() == 1)

{

itemstack.setitemdamage(0);

player.inventory.addItemStackToInventory(new itemstack(items.bucket));

}

 

that is the rough idea.

 

Link to comment
Share on other sites

that or make your salt have sub items, and one of them is "bucket of salt" which has an onUpdate function that when it's in a player's inventory will turn into salt, and give an empty bucket.

 

So smelt water bucket -> salt bucket -> salt + bucket

 

salt is damage value of 0

salt bucket is damage value of 1

 

onUpdate()

if (itemstack.getitemDamage == 1)

{

consume salt bucket, add salt, and add bucket

}

 

This!

I'll need help, and I'll give help. Just ask, you know I will!

Link to comment
Share on other sites

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.