Class CommandItem

All Implemented Interfaces:
Item

public class CommandItem extends SimpleItem
An Item that will force a player to run a command or say something in the chat when clicked.
  • Constructor Details

    • CommandItem

      public CommandItem(@NotNull @NotNull ItemProvider itemProvider, @NotNull @NotNull String command)
  • Method Details

    • handleClick

      public void handleClick(@NotNull @NotNull org.bukkit.event.inventory.ClickType clickType, @NotNull @NotNull org.bukkit.entity.Player player, @NotNull @NotNull org.bukkit.event.inventory.InventoryClickEvent event)
      Description copied from interface: Item
      A method called if the ItemStack associated to this Item has been clicked by a player.
      Specified by:
      handleClick in interface Item
      Overrides:
      handleClick in class SimpleItem
      Parameters:
      clickType - The ClickType the Player performed.
      player - The Player who clicked on the ItemStack.
      event - The InventoryClickEvent associated with this click.