Jump to content

Aulig

Members
  • Posts

    42
  • Joined

  • Last visited

Everything posted by Aulig

  1. 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
  2. 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.
  3. 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.
  4. 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.
  5. 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.
  6. 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.
  7. 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?
  8. 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?
  9. Hm okay, thank you. I will create a new Thread just in case someone else knows the answer
  10. 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?
  11. 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?
  12. But how? I am not looking at a villager without a recipe.
  13. 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?
  14. Thanks, how do i move an item into the villagers input slot though?
  15. 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.
  16. Oh, ok. Is there another way i can detect if the player was attacked? I thought of checking if the players health was reduced, but maybe theres a different/simpler way to do it?
  17. My mod is clientside only, Im using the LivingHurtEvent. public void onLivingHurtEvent(LivingHurtEvent event){ if(event.entity instanceof EntityPlayer){ mc.thePlayer.motionX = 0; mc.thePlayer.motionZ = 0; } }
  18. Hello, Im trying to modify the players motion using this: mc.thePlayer.motionZ *= 0.5; mc.thePlayer.motionX *= 0.5; I tested it by seeing if the knockback is halfed, but it isnt. Then I tried setting it to 0 to make the change more obvious, but it also didnt work. mc.thePlayer.motionZ = 0; mc.thePlayer.motionX = 0;
  19. I wish i knew this earlier, couldve saved me a couple hours... Turns out i already couldve looked at the sources but i just didnt know they were where they are. Thanks a lot for taking your time to help me with my nooby questions.
  20. uhh, to look at the minecraft code. Thats the only way i could think of to get the standard sign model. Is mcp not the way you look at the mc source?
  21. thanks, but how do i get the vanilla sign model? Can I find it in the mcp? I assume that would be TileEntitySignRenderer, right? public class TileEntitySignRenderer extends TileEntitySpecialRenderer { private static final ResourceLocation field_147513_b = new ResourceLocation("textures/entity/sign.png"); /** The ModelSign instance for use in this renderer */ private final ModelSign model = new ModelSign(); private static final String __OBFID = "CL_00000970"; public void func_180541_a(TileEntitySign p_180541_1_, double p_180541_2_, double p_180541_4_, double p_180541_6_, float p_180541_8_, int p_180541_9_) { ... but what do i do with all the ofuscated methods and so on? (Note: MCP 1.8.8 doesnt work for me somehow, so im using 1.8. Is it deobfuscated better?)
  22. Well Im bad at explaining what i want apparently. Is there any way i can make it use the default sign TESR instead of my custom one? (obviously not all the time, as i sometimes want render it as red/green) Or do you mean that I can somehow edit the normal sign tesr?
  23. Okay, ill try to explain it as simple as i can. But also id like to thank you for taking this time to help me. So without a TESR the sign is rendered as a normal vanilla sign with the standard model and texture. (the sign is the tileentity im modifying) Then if "SignReader" is toggled i want it to check if the sign says the given text in the given line. If it does i replace it with a green box and if it doesnt with a red box. I have all of this worked out so i only need a way to reset the sign to a normal sign without anything modified. If i do it like you suggested i have the standard model but not the standard texture (its invisible, but the "hitbox" when looking at it shows that the shape is the standard one). The reason why i want to do that is because you cant read the text on it when its invisible/my custom model. I really hope this was understandable now
×
×
  • Create New...

Important Information

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