Everything posted by GravityWolf
-
Damage on passing through enemy
Thank you very much! There is one bug that I have found though, and didn't realize with your fall-damage negating method too. I want it so only if you have the item selected in your hotbar, then it negates fall damage/deals damage when touching. Currently, even when you don't have it selected, it still does damage. Also, it does damage when you are just walking. And question, what is the method (ex. onUpdate) for dashing? Thank you!
-
Negating Fall Damage whilst holding item
I'm mostly just making a mod for my server, and I really do want to learn how to be a better modder.
-
Damage on passing through enemy
I know this is a very, VERY, complicated request, but you would definitely go in the credits of my mod. Alright, so I have this sword, and when you right click, it makes you zoom in the direction (Thank you, hydroflame!). Now, this is the part that might make you rip out your hair and scream just thinking about. When you zoom through an enemy, I want it to do damage. About 4 hearts of damage would do. If you would do this, I would be ever so grateful. And you would get applause :3 Thank you SO much if you do this! Here is the onItemRightClick event: @Override public ItemStack onItemRightClick(ItemStack itemStack, World world, EntityPlayer player) { player.motionY = 0.7; double calculatedX = 5 * (double) (-MathHelper.sin(player.rotationYaw/ 180.0F * (float) Math.PI)* MathHelper.cos(player.rotationPitch / 180.0F* (float) Math.PI) * 0.4f); double calculatedZ = 5 * (double) (MathHelper.cos(player.rotationYaw / 180.0F * (float) Math.PI)* MathHelper.cos(player.rotationPitch / 180.0F* (float) Math.PI) * 0.4f); double calculatedY = 5 * (double) (-MathHelper.sin((player.rotationPitch)/ 180.0F * (float) Math.PI) * 0.4f); player.motionY = calculatedY; player.motionX = calculatedX; player.motionZ = calculatedZ; player.fallDistance = 0.0f; return itemStack; }
-
[SOLVED]HOW DO TEXTURES WORK 1.6.2
Just for future reference, would I put this in my package that I already have for my mod, or would I make an entirely new package?
-
Negating Fall Damage whilst holding item
Applause to you, sir! I could never figure out this kinda code on my own I am new to coding.
-
[SOLVED]HOW DO TEXTURES WORK 1.6.2
Put it in mcp>src>minecraft>assets>(lowercase mod ID)>textures>items Make new folders if they don't exists already.
-
Negating Fall Damage whilst holding item
Ok, so when my item is right clicked, it sends the player launching in the direction they are looking. (Thank you hydroflame ) This would be fine, but, however, if the player is in survival mode, they, of course, take massive amounts of fall damage. So, this is what I tried doing (yes, I do have the fallDistance variable): @Override public ItemStack onItemRightClick(ItemStack itemStack, World world, EntityPlayer player) { player.motionY = 0.7; double calculatedX = 10 * (double) (-MathHelper.sin(player.rotationYaw/ 180.0F * (float) Math.PI)* MathHelper.cos(player.rotationPitch / 180.0F* (float) Math.PI) * 0.4f); double calculatedZ = 10 * (double) (MathHelper.cos(player.rotationYaw / 180.0F * (float) Math.PI)* MathHelper.cos(player.rotationPitch / 180.0F* (float) Math.PI) * 0.4f); double calculatedY = 10 * (double) (-MathHelper.sin((player.rotationPitch)/ 180.0F * (float) Math.PI) * 0.4f); player.motionY = calculatedY; player.motionX = calculatedX; player.motionZ = calculatedZ; player.fallDistance = 0.0f; return itemStack; } Of course, though, when you right click again, it just makes you fly again, adding more fallDistance, which means you always take fall damage. I'm having trouble finding a fix. If I could find a way to do a loop when holding this item (It would be OK to negate all fall damage when holding this) and continually set fall distance to 0. Of course, I have very limited Java knowledge so I do not know how to do this. If someone could help, that would be great!
-
Launching in direction looking?
Thank you sooooooooo much!!! Applause for you! Works perfectly! Now how to figure out how to negate fall damage!
-
Launching in direction looking?
Lol I feel like such a noob...says calculated(x y and z) cannot be resolved to a variable I am trying to get better
-
Launching in direction looking?
Hmm..I put it in my onItemRightclick method and it does nothing...here is this code: @Override public ItemStack onItemRightClick(ItemStack itemStack, World world, EntityPlayer player) { player.motionY = 0.7; double motionX = 20 * (double) (-MathHelper.sin(player.rotationYaw/ 180.0F * (float) Math.PI)* MathHelper.cos(player.rotationPitch / 180.0F* (float) Math.PI) * 0.4f); double motionZ = 20 * (double) (MathHelper.cos(player.rotationYaw / 180.0F * (float) Math.PI)* MathHelper.cos(player.rotationPitch / 180.0F* (float) Math.PI) * 0.4f); double motionY = 20 * (double) (-MathHelper.sin((player.rotationPitch)/ 180.0F * (float) Math.PI) * 0.4f); return itemStack; } Sorry about my noobishness, I am new to modding like I said Edit: Is Pi already in Eclipse/Forge/Minecraft, or is it another class you have? Same with MathHelper.
-
Launching in direction looking?
On "* f" It gives me an error, are you using a variable that you had or something? It crashes when I use the item.
-
Launching in direction looking?
I am fairly new to making mods, and I am making an item that launches you up and sends you launching in the direction you are looking. Here is the code I am currently using to make the player launch up when they right click with the item: @Override public ItemStack onItemRightClick(ItemStack itemStack, World world, EntityPlayer player) { player.motionY = 0.7; return itemStack; } Any ideas? Thanks!
IPS spam blocked by CleanTalk.