i need plugin death message i can custom it like when player kill another player i want them to say [X] Player Killed By iNasserDev not Player was slain by iNasserDev
Have you tried looking this up? If you're having trouble I can google it for you and send you the link... but it should be self-explanatory. Basically everyone here doesn't make a plugin for you if exactly what you describe already exists... unless you have a significant enough problem with the existing plugin.
Hey iNasserDev, i'm a new Developer and i'm trying some things out. So did I with your plugin suggestion, here is your plugin. Functions: - Customizable death-message with colors - normal death-message is disabled Placeholder: %KILLER - killer %VICTIM - victim I know it isn't that much, but it was a nice little task for me^^ EDIT: Changed the death-message only for playerkills!
@FlaveDrake , I was wondering if you could send a link for the source code to that plugin, it's just I'm fairly new to Bukkit and wanted to see how you made the placeholders.
@615283, of course but i don't know how to link sources, so i have to send you my code: Code:java package com.FlaveDrake.DeathMessage.listener; import org.bukkit.Bukkit;import org.bukkit.configuration.file.FileConfiguration;import org.bukkit.entity.Player;import org.bukkit.event.EventHandler;import org.bukkit.event.Listener;import org.bukkit.event.entity.PlayerDeathEvent; import com.FlaveDrake.DeathMessage.main.Main; public class DeathMessageListener implements Listener { public static String colorize(String msg) { String coloredMsg = ""; for (int i = 0; i < msg.length(); i++) { if (msg.charAt(i) == '&') coloredMsg += '§'; else coloredMsg += msg.charAt(i); } return coloredMsg; } @EventHandler public void onDeath(PlayerDeathEvent e) { Player victim = e.getEntity(); Player killer = victim.getKiller(); FileConfiguration cfg = Main.getPlugin().getConfig(); String deathmessage = cfg.getString("Messages.death-message"); if (deathmessage != null && killer != null) { e.setDeathMessage(null); deathmessage = deathmessage.replaceAll("%KILLER", killer.getName()).replaceAll("%VICTIM", victim.getName()); //This is how i made placeholder Bukkit.broadcastMessage(colorize(deathmessage)); } }} EDIT Hope i could helped you out, if you have any questions pm me.
@FlaveDrake You can use ChatColor#translateAlternateColorCode("§", msg); Also it's a good practice to load informartion from config on enable instead of everytime the event triggers. Other than that, good logic.