Skip to content

Commit

Permalink
Change PlayerJoinEvent example to PlayerDamageByPlayerEvent
Browse files Browse the repository at this point in the history
  • Loading branch information
srnyx committed Jan 4, 2023
1 parent 6c91c92 commit 565a9a6
Showing 1 changed file with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

import xyz.srnyx.annoyingapi.AnnoyingListener;
import xyz.srnyx.annoyingapi.AnnoyingMessage;
import xyz.srnyx.annoyingapi.events.PlayerDamageByPlayerEvent;


/**
Expand Down Expand Up @@ -45,7 +46,11 @@ public ExamplePlugin getPlugin() {
* @param event the {@link PlayerJoinEvent} event
*/
@EventHandler
public void onPlayerJoin(@NotNull PlayerJoinEvent event) {
new AnnoyingMessage(plugin, "join").send(event.getPlayer());
public void onPlayerDamageByPlayer(@NotNull PlayerDamageByPlayerEvent event) {
new AnnoyingMessage(plugin, "attack")
.replace("%damager%", event.getDamager().getName())
.replace("%damagee%", event.getDamagee().getName())
.replace("%damage%", event.getDamage())
.broadcast(AnnoyingMessage.BroadcastType.CHAT);
}
}

0 comments on commit 565a9a6

Please sign in to comment.