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.

Featured Replies

Posted

I'm making a program that calculates damage in almost any possible situation in Minecraft (it's far from finished, even design wise):

 

R35kiXQ.png

 

The problem is this, I can't find a way to get consistent, correct damage values when some mobs hold stuff like wooden axes or gold pickaxes (via commands for adventure maps). I was told forge has that info, but where could can I find it?

Provided that Mojang / any modders correctly implement their weapon-holding mobs, you'd get the correct attack damage simply by getting the current value for the mob's SharedMonsterAttribute for attackDamage.

 

However, I don't think that mobs calculate their actual total in the same way players do, but you can still use that to get their base damage value (usually) and then use entity#getHeldItem() to get their held ItemStack. Once you have the ItemStack, you can find all of its AttributeModifiers and Enchantments using various methods in ItemStack/Item and via NBT for enchantments.

  • Author

Where can I find all of this info? And do I need to pretty much learn how Java and whatnot to fully nail this down?

Where can I find all of this info? And do I need to pretty much learn how Java and whatnot to fully nail this down?

 

Oh, I see. You're making this calculator as a stand-alone application using some other programming language or tool? I thought you meant to make an in-game GUI that was a calculator.

 

I guess one way to do it instead would be to trust the information on the various Minecraft wikis out there. Most of them seem to have information that people got directly from the code (like every item indicates the ID and such, which are from the code). So if you look up each entity, each weapon, each relevant potion (there are only a couple that would affect damage), there may be enough description there.

 

So did you read pages like this one that explains damage: http://minecraft.gamepedia.com/Damage

 

This one explains attributes and attribute modifiers: http://minecraft.gamepedia.com/Attribute#Attributes_available_on_all_living_entities

 

This one explains enchantments: http://minecraft.gamepedia.com/Enchantments#Enchantments

 

Check out my tutorials here: http://jabelarminecraft.blogspot.com/

  • Author

It seems like damage can be randomized a bit with mobs, so... that would make my program pointless?

It seems like damage can be randomized a bit with mobs, so... that would make my program pointless?

 

No. You can still give the range. Have a min and max damage calculated. I kinda like the idea of the calculator and your design is nice. It's just that making it accurate will take a bit of detailed attention.

Check out my tutorials here: http://jabelarminecraft.blogspot.com/

  • Author

People keep mentioning how I can print damage done to something. How do I do that? I could just have a spawned entity damage another entity over and over but how do I see the exact damage?

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

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.