this is in the paper-plugin.yml
commands:
food:
description: Gives a stack of food!
usage: /<command>
freehealth:
description: Gives free health!
usage: /<command>
This is the code in the main class:
commands:
food:
description: Gives a stack of food!
usage: /<command>
freehealth:
description: Gives free health!
usage: /<command>
This is the code in the main class:
Code:
if (command.getName().equalsIgnoreCase("food"))
{
if (sender instanceof Player) {
Player p = (Player)sender;
p.getInventory().addItem(new ItemStack(Material.COOKED_BEEF, 64));
p.sendMessage(ChatColor.GREEN + "You got a stack of" + ChatColor.BOLD + "FOOD!");
}
}
if (command.getName().equalsIgnoreCase("freehealth"))
{
if (sender instanceof Player) {
Player p = (Player)sender;
p.setHealth(p.getHealth() + 1);
}
}