Aulig Posted May 19, 2016 Share Posted May 19, 2016 Hello, is it possible to find out what trade a player is looking at after he clicked the villager? I only need to know what type of item the villager wants, the amount doesnt matter. Then id like to move the required item to the villagers "Input" slot. What i dont know is how i find out the trade and how i move the item. Thanks in advance. Quote Link to comment Share on other sites More sharing options...
Aulig Posted May 21, 2016 Author Share Posted May 21, 2016 Thanks, how do i move an item into the villagers input slot though? Quote Link to comment Share on other sites More sharing options...
Aulig Posted May 22, 2016 Author Share Posted May 22, 2016 Ah, great! Thanks a lot Quote Link to comment Share on other sites More sharing options...
Aulig Posted May 22, 2016 Author Share Posted May 22, 2016 Hm... Im getting a Nullpointer Exception with this code: if(mc.thePlayer.openContainer instanceof ContainerMerchant){ ItemStack requested =((ContainerMerchant) mc.thePlayer.openContainer).getMerchantInventory().getCurrentRecipe().getItemToBuy(); The error occurs once i click the villager. Do you know why this is happening? Quote Link to comment Share on other sites More sharing options...
Aulig Posted May 22, 2016 Author Share Posted May 22, 2016 But how? I am not looking at a villager without a recipe. Quote Link to comment Share on other sites More sharing options...
Aulig Posted May 23, 2016 Author Share Posted May 23, 2016 So actually (from what ive found out from some testing now) getCurrentRecipe is only then not null when the player puts in enough of the requested item into the villagers input slot so that the trade would be possible. This is kind of problematic as i want to put in the items automatically (before anything is in there). Do you know an alternative? Quote Link to comment Share on other sites More sharing options...
Aulig Posted May 23, 2016 Author Share Posted May 23, 2016 I think i could do that, but what do i do with the index then? Can you get the trade (using the index) from the MerchantRecipeList? Quote Link to comment Share on other sites More sharing options...
Aulig Posted May 23, 2016 Author Share Posted May 23, 2016 Hm okay, thank you. I will create a new Thread just in case someone else knows the answer Quote Link to comment Share on other sites More sharing options...
Aulig Posted May 23, 2016 Author Share Posted May 23, 2016 Well i doubt anyone will read this thread to the end. also i had a new idea i wanted to include, but youre the moderator - you decide. Feel free to delete it if you dont think its ok, im sorry in that case. Quote Link to comment Share on other sites More sharing options...
Aulig Posted May 23, 2016 Author Share Posted May 23, 2016 Well i doubt anyone will read this thread to the end. also i had a new idea i wanted to include, but youre the moderator - you decide. Feel free to delete it if you dont think its ok, im sorry in that case. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.