diff --git a/src/main/java/net/flectone/chat/module/serverMessage/death/DeathModule.java b/src/main/java/net/flectone/chat/module/serverMessage/death/DeathModule.java index 283dc1d..6bdd62a 100644 --- a/src/main/java/net/flectone/chat/module/serverMessage/death/DeathModule.java +++ b/src/main/java/net/flectone/chat/module/serverMessage/death/DeathModule.java @@ -111,8 +111,8 @@ public void sendMessage(@NotNull Player sender, @Nullable Player player, @NotNul public void createEntityComponent(@NotNull Player sender, @Nullable Player player, @Nullable Entity entity, @NotNull ComponentBuilder componentBuilder, String color) { if (entity == null) return; - if (entity instanceof Player) { - componentBuilder.append(new FPlayerComponent(player, entity, color + entity.getName()).get()); + if (entity instanceof Player entityPlayer) { + componentBuilder.append(new FPlayerComponent(entityPlayer, player, color + entity.getName()).get()); return; }