Jump to content

Automate craft process from the client side


Recommended Posts

Lets suppose you have two stone blocks, two plank blocks, a stick, and some coal.

What should get crafted?

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.


Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.


DO NOT PM ME WITH PROBLEMS. No help will be given.

Link to comment
Share on other sites

So the class EntityPlayer has the field inventoryContainer. That's what you're telling me about, right?

I've tried to do some manipulations with slots, however it seems that the server doesn't allow me to do that in such a way or doesn't know what I've done there.

//Take 2 items from the first slot in the hotbar. Just imagine you have 2 stone blocks in your first hotbar slot
ItemStack s1 = player.inventoryContainer.getSlotFromInventory(player.inventory, 0).decrStackSize(1);
ItemStack s2 = player.inventoryContainer.getSlotFromInventory(player.inventory, 0).decrStackSize(1);
//                                                                                       |1|2|
//Now put obtained ItemStacks to the crafting grid. It has the following slot numbering: |3|4|. Craft result slot is number 0
player.inventoryContainer.putStackInSlot(1, s1);
player.inventoryContainer.putStackInSlot(2, s2);

//Finally put the result to the first hotbar slot


Edited by ZhabaKlava
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.

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.


  • Create New...

Important Information

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