Code: private Main plugin; public TeleportListener(Main plugin) { this.plugin = plugin; Bukkit.getPluginManager().registerEvents(this, plugin); } @EventHandler public void onTeleport(PlayerTeleportEvent e) { Player p = e.getPlayer(); if (!p.isOp()) { p.sendMessage(Utils.chat(plugin.getConfig().getString("not_op_message"))); } else { p.sendMessage(Utils.chat(plugin.getConfig().getString("teleport_message").replace("<player>", p.getName()))); } } } Ok so basically I'm trying to make a custom Teleport reply but when I do /tp <player> it says my IGN I know it's because I have p.getName but how do I make it say the target's name?
@Tzipi I'm not sure i understand what you mean but, you can get a player using Bukkit#getPlayer(String name)
@Tzipi The player in the event is the one that got teleported. You probably want to send the message in the command method, not the teleport event.