Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

GravityWolf

Members
  • Joined

  • Last visited

Everything posted by GravityWolf

  1. 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!
  2. I'm mostly just making a mod for my server, and I really do want to learn how to be a better modder.
  3. 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; }
  4. 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?
  5. Applause to you, sir! I could never figure out this kinda code on my own I am new to coding.
  6. Put it in mcp>src>minecraft>assets>(lowercase mod ID)>textures>items Make new folders if they don't exists already.
  7. 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!
  8. Thank you sooooooooo much!!! Applause for you! Works perfectly! Now how to figure out how to negate fall damage!
  9. 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
  10. 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.
  11. On "* f" It gives me an error, are you using a variable that you had or something? It crashes when I use the item.
  12. 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!

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.