Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
GiveCommand with Levitate
public void onEnable() {
Levitate levitate = new Levitate(this);
levitate.registerCommands(this);
}
@Command(syntax = "?give <player[online]> <item> <int[0-64]>")
public void giveCommand(CommandSender sender, String cmd, ParameterSet args) {
sender.sendMessage("Given "\" + args.getPlayer(0).getDisplayName() + "\" " + args.getInt(2) + "x of "\" + args.getString(1) + "\"!");
ItemStack is = args.getItemStack(1);
is.setAmount(args.getInt(2));
args.getPlayer(0).getInventory().addItem(is);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.