Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @EventHandler
- public void onClickInventoryy(InventoryClickEvent e) {
- Player player = (Player) e.getWhoClicked();
- FileConfiguration config = plugin.getConfig();
- String name = config.getString("Inventory-Selector.Title");
- String nname = ChatColor.stripColor(name);
- if(ChatColor.stripColor(e.getInventory().getName()).equals(nname)){
- if(e.getCurrentItem() == null || e.getSlotType() == null || e.getCurrentItem().getType() == Material.AIR) {
- e.setCancelled(true);
- return;
- }else {
- if(e.getCurrentItem().hasItemMeta()) {
- e.setCancelled(true);
- }else{
- e.setCancelled(true);
- return;
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment