HomeJavaModsMelonDamageLib
[​IMG]

MelonDamageLib
Better Damage Management and Kill Assist Tracker

The source of the project is on GitHub.
If you find a bug, or have another issue, open an Issue.

Server Owners
If the plugin is installed on a server, it will overwrite the default death messages as well as provide a players a summary of what damaged them within 5 seconds of their death

Developers
DamageLib can be used to assist with damage tracking, including for custom damage.

Logging Custom Damage
When you want to log the custom damage, just instantiate a new OtherDamageTick.

Code (Java):
Player player = ... ; // Also compatible with entities, there's just no chat output
double damage = 10 ; // My damage
EntityDamageEvent. DamageCause cause = EntityDamageEvent. DamageCause. CUSTOM ; // An associated damage cause
String name = "Special Move" ; // Used for display purposes
long time = System. currentTimeMillis ( ) ; // The time of when this happened. Damage received over 5 seconds ago will not be shown.

OtherDamageTick tick = new OtherDamageTick (damage, cause, name, time ) ;
DamageManager. logTick (player. getUniqueId ( ), tick ) ;
Custom Damage Tick
A damage tick simply represents a type of damage. They're used to assist with tracking of past damage events.

New custom damage tick classes should extend the DamageTick class.

Events
PlayerAssistedWithDeathEvent
This event contains the player that was killed, and a KillAssist object, which contains the player who made the assist, the percentage of damage the player dealt, and the raw amount of damage they dealt.

For an assist to be registered, the cause of death must not match the player on the assist, and the assist must have been for at least 20% of the total PVP damage.

By default, KillAssists are only used to modify the death message, however this event can be listened for by other plugins for more accurate statistic tracking.

EntityDamagedByPlayerTNTEvent
Fired when an entity is damaged by TNT that has a source of a player. Listening to this event can be a nice shortcut to EntityDamageByEntityEvent.

If cancelled, the damage will be negated and the damage won't be logged to the entity being damaged.

Plugin details

Read from the plugin's own plugin.yml.

Quick facts

Install steps are the general flow for this file type — How to install Minecraft Java mods & modpacks walks through it step by step.

MelonDamageLib is a free Minecraft Java mod. Compatible with Minecraft 1.8. Downloaded 717 times (via Spigot). Download it and open it directly in the game.

Explore more