mirror of
https://github.com/EngineHub/WorldGuard.git
synced 2025-01-12 11:21:34 +01:00
Add debug listener for DamageEntityEvent.
This commit is contained in:
parent
144c31645c
commit
f8e129f33e
@ -23,6 +23,7 @@
|
||||
import com.sk89q.worldguard.bukkit.event.block.BreakBlockEvent;
|
||||
import com.sk89q.worldguard.bukkit.event.block.PlaceBlockEvent;
|
||||
import com.sk89q.worldguard.bukkit.event.block.UseBlockEvent;
|
||||
import com.sk89q.worldguard.bukkit.event.entity.DamageEntityEvent;
|
||||
import com.sk89q.worldguard.bukkit.event.entity.DestroyEntityEvent;
|
||||
import com.sk89q.worldguard.bukkit.event.entity.SpawnEntityEvent;
|
||||
import com.sk89q.worldguard.bukkit.event.entity.UseEntityEvent;
|
||||
@ -164,6 +165,24 @@ public void onUseEntity(UseEntityEvent event) {
|
||||
logger.info(builder.toString());
|
||||
}
|
||||
|
||||
@EventHandler(priority = EventPriority.MONITOR)
|
||||
public void onDamageEntity(DamageEntityEvent event) {
|
||||
StringBuilder builder = new StringBuilder();
|
||||
builder.append("DAMAGE");
|
||||
builder.append(" ");
|
||||
builder.append("").append(event.getEntity().getType());
|
||||
builder.append(" ");
|
||||
builder.append("[").append(event.getCause()).append("]");
|
||||
builder.append(" ");
|
||||
builder.append("@").append(toBlockString(event.getTarget()));
|
||||
builder.append(" ");
|
||||
builder.append(":").append(getEventName(event.getOriginalEvent()));
|
||||
if (event.getResult() != Result.DEFAULT) {
|
||||
builder.append(" [").append(event.getResult()).append("]");
|
||||
}
|
||||
logger.info(builder.toString());
|
||||
}
|
||||
|
||||
@EventHandler(priority = EventPriority.MONITOR)
|
||||
public void onUseItem(UseItemEvent event) {
|
||||
StringBuilder builder = new StringBuilder();
|
||||
|
Loading…
Reference in New Issue
Block a user