OzzzyGreen Posted March 23, 2018 Posted March 23, 2018 Hi guys! My english is not the best, but anyway. I need to track the damage received from a certain item, how can I do this? Thanks Quote
OzzzyGreen Posted March 23, 2018 Author Posted March 23, 2018 Just now, diesieben07 said: Please clarify what you mean by "track". Check damage from item Quote
OzzzyGreen Posted March 23, 2018 Author Posted March 23, 2018 Just now, diesieben07 said: Do you want to check how much damage a player has done with a specific item? Not quite I want something like this: if (received damage from the diamond sword) { // this ... } Quote
OzzzyGreen Posted March 23, 2018 Author Posted March 23, 2018 Just now, diesieben07 said: LivingHurtEvent is fired when an entity takes damage. You can then extract the source entity using DamageSource::getTrueSource. Then you can check if that entity is a living entity (EntityLivingBase) and obtain the item being held (getHeldItem(getActiveHand)) I'm just a beginner. If not difficult, can you show how it is applied in practice? Quote
Draco18s Posted March 23, 2018 Posted March 23, 2018 http://mcforge.readthedocs.io/en/latest/events/intro/ Quote Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable. If you think this is the case, JUST REPORT ME. Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice. Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked. DO NOT PM ME WITH PROBLEMS. No help will be given.
Recommended Posts
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.