Advertisement
Guest User

Untitled

a guest
Dec 12th, 2017
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.48 KB | None | 0 0
  1. import java.util.Arrays;
  2.  
  3. import org.bukkit.Material;
  4. import org.bukkit.command.Command;
  5. import org.bukkit.command.CommandExecutor;
  6. import org.bukkit.command.CommandSender;
  7. import org.bukkit.inventory.ItemStack;
  8.  
  9. import me.camdenorrb.kspigotbasics.ext.ItemExt;
  10. import me.camdenorrb.kspigotbasics.gui.events.ChestClickAction;
  11. import me.camdenorrb.kspigotbasics.gui.slot.ChestSlot;
  12. import me.camdenorrb.kspigotbasics.gui.types.ChestGui;
  13. import me.camdenorrb.kspigotbasics.gui.utils.GuiUtils;
  14.  
  15. public class WebsiteCommand
  16. implements CommandExecutor
  17. {
  18. public boolean onCommand(CommandSender sender, Command command, String label, String[] args)
  19. {
  20. ChestGui chestGui = GuiUtils.chestGui("Name of Chest", 9, gui -> {
  21.  
  22. ChestSlot slot1 = gui.setSlot(ItemExt.meta(new ItemStack(Material.WORKBENCH), itemMeta -> itemMeta.setDisplayName("Name Of Item")), 0);
  23. slot1.addAction(ChestClickAction::closeGui);
  24.  
  25. ChestSlot slot2 = gui.setSlot(ItemExt.meta(new ItemStack(Material.DIAMOND_AXE), itemMeta -> itemMeta.setDisplayName("Name Of Item")), 2);
  26. slot2.addAction(it -> it.getWhoClicked().sendMessage("You clicked the axe!"));
  27.  
  28. ChestSlot slot3 = gui.setSlot(ItemExt.meta(new ItemStack(Material.BOOK), it -> {
  29. it.setDisplayName("item name");
  30.  
  31. }), 4);
  32. slot3.addAction(action -> {
  33. action.closeGui();
  34. action.getWhoClicked().sendMessage("You clicked a book!");
  35. });
  36. });
  37. return false;
  38. }
  39. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement