Advertisement
Sn0wFR

script inventaire

Apr 5th, 2020
232
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.45 KB | None | 0 0
  1. public class CreateInventory {
  2.  
  3.     private Inventory inv;
  4.    
  5.    
  6.     public CreateInventory(String name, int size) {
  7.        
  8.         if(size <= 8) {
  9.             size = 9;
  10.         }
  11.        
  12.         if(size >= 55) {
  13.             size = 54;
  14.         }
  15.        
  16.         inv = Bukkit.createInventory(null, size, name);
  17.        
  18.        
  19.        
  20.     }
  21.    
  22.     public void SetItemInInventory(int slot, ItemStack it) {
  23.        
  24.        
  25.        
  26.         inv.setItem(slot, it);
  27.        
  28.     }
  29.    
  30.     public void openMenu(Player player) {
  31.         player.openInventory(inv);
  32.     }
  33.    
  34.    
  35. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement