EntityDamage API

This project is abandoned and its default file will likely not work with the most recent version of Minecraft. Whether this project is out of date or its author has marked it as abandoned, this project is no longer maintained.

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.

MethodReturnsDescription
getVictim()LivingEntityReturns the entity that has been attacked
getAttacker()LivingEntityReturns the entity that has attacked the victim - Returns the thrower of projectiles!
getHealthDamage()doubleReturns the amount of hearts damage dealt to the victim. Accurate to 1/10th of a heart.
getAbsoluteHealthDamage()doubeReturns the exact amount of hearts damage dealt to the victim
getHealthBefore()doubeReturns the amount of health the victim had before the attack
getHealthAfter()doubeReturns the amount of health the victim has after the attack
.
EntityDamageAPI.getEnity(UUID id)EntitySearches 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

Comments

Posts Quoted:
Reply
Clear All Quotes

About This Project

Categories

Members

Recent Files

Bukkit