Brandon12121

Kit code

Dec 10th, 2021
190
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.22 KB | None | 0 0
  1. package me.brandonbr1.kit.kitplugin.commands;
  2.  
  3. // Command
  4. // copy the code in the description
  5. // change the class to your own class name
  6.  
  7. import org.bukkit.Material;
  8. import org.bukkit.command.CommandExecutor;
  9. import org.bukkit.command.CommandSender;
  10. import org.bukkit.entity.Player;
  11. import org.bukkit.inventory.ItemStack;
  12.  
  13. public class Command implements CommandExecutor {
  14.  
  15. @Override
  16. public boolean onCommand(CommandSender sender, org.bukkit.command.Command command, String label, String[] args) {
  17.  
  18. if (sender instanceof Player) {
  19. Player player = (Player) sender;
  20. // Here we need to give items to our player
  21. //now change the amount if you want to
  22.  
  23.  
  24.  
  25. ItemStack diamond = new ItemStack(Material.DIAMOND_AXE);
  26. //change it based on what appears on the list
  27.  
  28. // Create a new ItemStack (type: brick)
  29. ItemStack bricks = new ItemStack(Material.BRICK);
  30.  
  31. // Set the amount of the ItemStack
  32. bricks.setAmount(20);
  33.  
  34. // Give the player our items (comma-seperated list of all ItemStack)
  35. player.getInventory().addItem(bricks, diamond);
  36. }
  37.  
  38. return true;
  39. }
  40. }
Advertisement
Add Comment
Please, Sign In to add comment