API
CombatLog API
CombatLog now has an API that allows developers to hook into the CombatLog plugin and listen for three events:
- PlayerCombatLogEvent
- PlayerTagEvent
- PlayerUntagEvent
Using these three events is quite simple, one can use them just like normal events.
public class YourListenerClass implements Listener { @EventHandler public void onCombatLogEvent(PlayerCombatLogEvent event) { event.getPlayer(); //Returns the player who combat logged } @EventHandler public void onPlayerTagEvent(PlayerTagEvent event) { event.getDamager(); //Returns the player who DOES the damage event.getDamagee(); //Returns the player who RECEIVES the damage } @EventHandler public void onPlayerUntagEvent(PlayerUntagEvent event) { event.getPlayer(); //Returns the player who is untagged
event.getCause(); //Returns the reason for Untagging the player } }
Can you provide an event to cancel the teleportation blocker? Also access to the list where you store current combat logged players.