public class GodCommand implements CommandExecutor {
@Override
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
if (sender instanceof Player) {
Player p = (Player) sender;
if (p.isInvulnerable()) {
if (p.hasPermission("pUtilities.god")) {
p.setInvulnerable(false);
p.sendMessage(ChatColor.RED + "" + ChatColor.BOLD + "You are no longer in godmode");
public class Heal 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("pUtilities.heal")) {
player.setFoodLevel(20);
player.setHealth(20);
player.sendMessage(ChatColor.RED + "" + ChatColor.BOLD + "You Healed yourself");
playe<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>me.taylor</groupId>
<artifactId>pUtilities</artifactId>
<version>1.2-BETA</version>
<packaging>jar</packaging>
<name>Commands2</name>
<description>Coded by PhrogiWname: pUtilities
version: '${project.version}'
main: me.taylor.commands2.Commands2
api-version: 1.18
authors: [ PhrogiWasHere ]
description: Coded by PhrogiWasHere
website: https://youtube.com/c/phrogi
commands:
god:
aliases:
- godmode
- g
description: Become invincible. Re-enter the command to toggle godmode.
usage: /<command>
permission: pUtilities.god
feed:
aliases:
- food
- f
- hunger
description: Fills up hungerbar.
usage: /<commpublic class Feed 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("pUtilities.feed")) {
player.setFoodLevel(20);
player.sendMessage(ChatColor.RED + "" + ChatColor.BOLD + "You fed yourself");
player.playSound(player.getLocation(), Sound.ENTITY_ARROW_public class Vanish implements CommandExecutor {
@Override
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
if (sender instanceof Player) {
Player p = (Player) sender;
if (p.isInvisible()) {
if (p.hasPermission("pUtilities.vanish")) {
p.setInvisible(false);
p.sendMessage(ChatColor.RED + "" + ChatColor.BOLD + "You are no longer in Vanish");
public final class Commands2 extends JavaPlugin {
@Override
public void onEnable() {
System.out.println("[pUtilities] Coded by PhrogiWasHere");
getCommand("god").setExecutor(new GodCommand());
getCommand("feed").setExecutor(new Feed());
getCommand("vanish").setExecutor(new Vanish());
getCommand("heal").setExecutor(new Heal());
}
}