For episode 6: https://www.youtube.com/watch?v=jytF-6WD2Eo&list=PLfu_Bpi_zcDNEKmR82hnbv9UxQ16nUBF7&index=6
package me.illuminatiproductions.spigotsandboxproject.commands;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
public class God implements CommandExecutor {
@Override
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
if (sender instanceof Player){
Player player = (Player) sender;
if(player.hasPermission("spigotsandboxproject.god")){
player.sendMessage("WOOSH");
player.setInvulnerable(true);
}else {
player.sendMessage("You do not have the required permission to execute this command");
}
}
return true;
}
}