GUI

Constructors

public GUI(JavaPlugin plugin, int size, String title)

Options:

  • plugin - your plugin instance

  • size - gui size (may be 5, 9, 18, 27, 36, 45, 54)

  • title - gui title

public GUI(JavaPlugin plugin, int size, String title, Player.. player)

Options:

  • plugin - your plugin instance

  • size - gui size (may be 5, 9, 18, 27, 36, 45, 54)

  • title - gui title

  • player - players for whom the GUI will now open

Title

Set title

public void setTitle(String title)

Get title

public String getTitle()

Item

Set item

public void setItem(int slot, ItemStack item, ClickAction action)

Options:

  • slot - slot in which the item will be

  • item - ItemStack

  • action - click action

Add item on free slot

public void addItem(ItemStack item, ClickAction action)

Options:

  • item - ItemStack

  • action - click action

Set Close Action

public void setCloseAction(CloseAction closeAction)

Set Border

public void setBorder(ItemStack item, BorderStyle style)

Options:

  • item - border item

  • style - border style

public enum BorderStyle {
   FULL,
   VERTICAL,
   TOP_ONLY,
   BOTTOM_ONLY,
   LEFT_ONLY,
   RIGHT_ONLY,
   HORIZONTAL;
}

Set Background

Places on all free item slots

public void setBackground(ItemStack item)

Player

Open GUI for player

public void addPlayer(Player player)

Close GUI for player

public void removePlayer(Player player)

Returns all players using the GUI

public ArrayList<Player> getPlayers()

Get Size

Return GUI size

public int getSize()

Last updated