Aulig
Members-
Posts
42 -
Joined
-
Last visited
Converted
-
Gender
Undisclosed
-
Personal Text
Still new to forge!
Aulig's Achievements
Tree Puncher (2/8)
0
Reputation
-
Hey everyone, Id like to find an entity between the player and another entity. I tried doing a raytrace (make the player face the entity thats further away) but it didnt really work. I hope someone knows a different approach. Thanks in advance
-
Hey, as you can read from the title i want to slow the player down, using my clientside mod. So far i tried changing the player capability, motionX/motionZ and giving the player slowness. Either i did something wrong when testing or those dont work in this scenario. Thanks in advance.
-
[1.8.9] Get villager trade the player is looking at
Aulig replied to Aulig's topic in Modder Support
Thanks a ton! Your code is great except for a few minor issues, eg it isnt e.getButton() but e.button. Also the detection if the gui was closed didnt work so i replaced it with a few if clauses and Keyboard.isKeyDown(18) and Keyboard.isKeyDown(1). (18 is "e" and 1 is escape) Wasnt that big of a deal though, just wanted to let you know in case it helps you. -
[1.8.9] Get villager trade the player is looking at
Aulig replied to Aulig's topic in Modder Support
Thanks a ton! Your code is great except for a few minor issues, eg it isnt e.getButton() but e.button. Also the detection if the gui was closed didnt work so i replaced it with a few if clauses and Keyboard.isKeyDown(18) and Keyboard.isKeyDown(1). (18 is "e" and 1 is escape) Wasnt that big of a deal though, just wanted to let you know in case it helps you. -
[1.8.9] Check current villager trade and move correct item
Aulig replied to Aulig's topic in Modder Support
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. -
[1.8.9] Check current villager trade and move correct item
Aulig replied to Aulig's topic in Modder Support
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. -
[1.8.9] Get villager trade the player is looking at
Aulig replied to Aulig's topic in Modder Support
Hello, after a conversation with diesieben07 (http://www.minecraftforge.net/forum/index.php/topic,39068.0.html) we noticed that its kind of difficult to get the current villager trade. I want it to work even if the player hasnt put in any items, so ContainerMerchant#getMerchantInventory().getCurrentRecipe() wont work. Maybe its possible to use the MerchantRecipeList or InventoryMerchant#currentRecipeIndex. It just crossed my mind that maybe the GuiMerchant class holds useful information. Slightly modified code: //The integer value corresponding to the currently selected merchant recipe. private int selectedMerchantRecipe; MerchantRecipe merchantrecipe = (MerchantRecipe)merchantrecipelist.get(selectedMerchantRecipe); Could this be used? -
Hello, after a conversation with diesieben07 (http://www.minecraftforge.net/forum/index.php/topic,39068.0.html) we noticed that its kind of difficult to get the current villager trade. I want it to work even if the player hasnt put in any items, so ContainerMerchant#getMerchantInventory().getCurrentRecipe() wont work. Maybe its possible to use the MerchantRecipeList or InventoryMerchant#currentRecipeIndex. It just crossed my mind that maybe the GuiMerchant class holds useful information. Slightly modified code: //The integer value corresponding to the currently selected merchant recipe. private int selectedMerchantRecipe; MerchantRecipe merchantrecipe = (MerchantRecipe)merchantrecipelist.get(selectedMerchantRecipe); Could this be used?
-
[1.8.9] Check current villager trade and move correct item
Aulig replied to Aulig's topic in Modder Support
Hm okay, thank you. I will create a new Thread just in case someone else knows the answer -
[1.8.9] Check current villager trade and move correct item
Aulig replied to Aulig's topic in Modder Support
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? -
[1.8.9] Check current villager trade and move correct item
Aulig replied to Aulig's topic in Modder Support
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? -
[1.8.9] Check current villager trade and move correct item
Aulig replied to Aulig's topic in Modder Support
But how? I am not looking at a villager without a recipe. -
[1.8.9] Check current villager trade and move correct item
Aulig replied to Aulig's topic in Modder Support
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? -
[1.8.9] Check current villager trade and move correct item
Aulig replied to Aulig's topic in Modder Support
Ah, great! Thanks a lot -
[1.8.9] Check current villager trade and move correct item
Aulig replied to Aulig's topic in Modder Support
Thanks, how do i move an item into the villagers input slot though?