Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Arrays;
- import org.bukkit.Material;
- import org.bukkit.command.Command;
- import org.bukkit.command.CommandExecutor;
- import org.bukkit.command.CommandSender;
- import org.bukkit.inventory.ItemStack;
- import me.camdenorrb.kspigotbasics.ext.ItemExt;
- import me.camdenorrb.kspigotbasics.gui.events.ChestClickAction;
- import me.camdenorrb.kspigotbasics.gui.slot.ChestSlot;
- import me.camdenorrb.kspigotbasics.gui.types.ChestGui;
- import me.camdenorrb.kspigotbasics.gui.utils.GuiUtils;
- public class WebsiteCommand
- implements CommandExecutor
- {
- public boolean onCommand(CommandSender sender, Command command, String label, String[] args)
- {
- ChestGui chestGui = GuiUtils.chestGui("Name of Chest", 9, gui -> {
- ChestSlot slot1 = gui.setSlot(ItemExt.meta(new ItemStack(Material.WORKBENCH), itemMeta -> itemMeta.setDisplayName("Name Of Item")), 0);
- slot1.addAction(ChestClickAction::closeGui);
- ChestSlot slot2 = gui.setSlot(ItemExt.meta(new ItemStack(Material.DIAMOND_AXE), itemMeta -> itemMeta.setDisplayName("Name Of Item")), 2);
- slot2.addAction(it -> it.getWhoClicked().sendMessage("You clicked the axe!"));
- ChestSlot slot3 = gui.setSlot(ItemExt.meta(new ItemStack(Material.BOOK), it -> {
- it.setDisplayName("item name");
- }), 4);
- slot3.addAction(action -> {
- action.closeGui();
- action.getWhoClicked().sendMessage("You clicked a book!");
- });
- });
- return false;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement