EntityDamage API
This plugin is a developer tool, it provides additional functionality when dealing with Entities in combat.
What it does
Provides a custom event which developers can use to get information about an attack between two entities (attacker and victim).
It provides a way for developers to get the true amount of hearts damage done to the victim. Unlike getDamage() it takes into account the armour worn by the victim, returning a much more accurate value.
How to use:
- For Server Owners
- This plugin is only required as a dependency for other plugins. To check whether you need this, search the BukkitDev page of your plugins to check their dependencies or check you console for any indication a plugin on your server requires EntityDamgeAPI.
- For Plugin Developers
- Simply add this plugin jar to your build. TUTORIAL TO GO HERE ONCE PLUGIN HAS BEEN PUBLISHED
Features
The EntityDamageAPI provides a new event. The EntityAttackedEvent which is called once the EntityDamageByEntityEvent has finished, which allows several functions to be accessed.
| Method | Returns | Description |
|---|---|---|
| getVictim() | LivingEntity | Returns the entity that has been attacked |
| getAttacker() | LivingEntity | Returns the entity that has attacked the victim - Returns the thrower of projectiles! |
| getHealthDamage() | double | Returns the amount of hearts damage dealt to the victim. Accurate to 1/10th of a heart. |
| getAbsoluteHealthDamage() | doube | Returns the exact amount of hearts damage dealt to the victim |
| getHealthBefore() | doube | Returns the amount of health the victim had before the attack |
| getHealthAfter() | doube | Returns the amount of health the victim has after the attack |
| . | ||
| EntityDamageAPI.getEnity(UUID id) | Entity | Searches the server for an Entity with specified UUID, returns null if none is found. |
| EntityDamageAPI.setDebug(boolean) | Sets whether debug message should be displayed in console each time the event occurs. |
Future Plans
- Release Version 0.1 EntityDamageAPI
- Add tutorial for developers
-
View User Profile
-
Send Message
Posted Dec 22, 2013@Simo389
Yeah, that's a bug in the current API, with the new 1.7.2 beta build I'm looking to rewrite the code to remove existing bugs and implement well with plugins.
-
View User Profile
-
Send Message
Posted Aug 23, 2013Sounds neat :)
-
View User Profile
-
Send Message
Posted Aug 15, 2013Looks very nice, I look forward to using it.