broken-arrow

Untitled

Dec 3rd, 2021 (edited)
771
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. public class TestMenuExample extends MenuHolder {
  2.  
  3.   private final MenuButton exampleButton;
  4.  
  5.   public TestMenuExample(Player player) {
  6.         super(main or simpleplugin.getinstance, 54);
  7.  
  8.         exampleButton = new MenuButton() {
  9.             @Override
  10.             public void onClickInsideMenu(Player player, Inventory menu, ClickType click, ItemStack clickedItem, Object object) {
  11.                     //do your own code
  12.             }
  13.  
  14.             @Override
  15.             public ItemStack getItem() {
  16.                //use this as you want.
  17.                 return new ItemStack(Material.HOPPER);
  18.             }
  19.         };
  20.  
  21.   public ItemStack getItemAt(int slot) {
  22.     if (slot == 5)
  23.     return exampleButton.getItem();
  24.     return null;
  25.   }
  26.  }
  27. }
RAW Paste Data