Anyone one know how to fix it so when u log out even if /fly aint active it will log you in with /fly im tried everything and nothing is working. please help
Don't even check for the permission, just check if their flight is set to allow.You could just do
@EventHandler
public void onJoin(PlayerJoinEvent e) {
Player player = e.getPlayer();
if(player.hasPermission("fly.join.allow")) {
Bukkit.dispatchCommand(player, "fly");
}
}
But with this code if your using essentials the player will be essentials.fly or what ever core your using they will need fly permissions or
@EventHandler
public void onJoin(PlayerJoinEvent e) {
Player player = e.getPlayer();
if(player.hasPermission("fly.join.allow")) {
player.setFlying(true);
player.sendMessage(ChatColor.GREEN + "You have logged in with /fly enabled");
}
}
Thanks for reading -
notG6
