Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package me.brandonbr1.kit.kitplugin.commands;
- // Command
- // copy the code in the description
- // change the class to your own class name
- import org.bukkit.Material;
- import org.bukkit.command.CommandExecutor;
- import org.bukkit.command.CommandSender;
- import org.bukkit.entity.Player;
- import org.bukkit.inventory.ItemStack;
- public class Command implements CommandExecutor {
- @Override
- public boolean onCommand(CommandSender sender, org.bukkit.command.Command command, String label, String[] args) {
- if (sender instanceof Player) {
- Player player = (Player) sender;
- // Here we need to give items to our player
- //now change the amount if you want to
- ItemStack diamond = new ItemStack(Material.DIAMOND_AXE);
- //change it based on what appears on the list
- // Create a new ItemStack (type: brick)
- ItemStack bricks = new ItemStack(Material.BRICK);
- // Set the amount of the ItemStack
- bricks.setAmount(20);
- // Give the player our items (comma-seperated list of all ItemStack)
- player.getInventory().addItem(bricks, diamond);
- }
- return true;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment