I'm writing the core plugin for my Minecraft server and I was implementing the PlayerJoin and Player leave functions when I came across this issue.
When I try to compile or package it says this:
Incompatible types. Found: 'java.lang.String', required: 'org.bukkit.entity.Player'
And I don't know what to do with it.
Heres the code:
import org.bukkit.ChatColor;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.player.PlayerJoinEvent;
public class PlayerJoin implements Listener {
@EventHandler
void onPlayerJoin(PlayerJoinEvent e){
Player player = e.getPlayer().getDisplayName();
e.setJoinMessage(ChatColor.GREEN + "[+] " + ChatColor.GRAY + "Welcome back adventurer! You may now continue your quest " + ChatColor.GREEN + player.getDisplayName());
}
}