Posted May 19, 20169 yr 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.
May 22, 20169 yr Author 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?
May 23, 20169 yr Author 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?
May 23, 20169 yr Author 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?
May 23, 20169 yr Author Hm okay, thank you. I will create a new Thread just in case someone else knows the answer
May 23, 20169 yr Author 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.
May 23, 20169 yr Author 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.
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.