NotCachaaaaaaaaaa

Untitled

Mar 19th, 2020
173
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.82 KB | None | 0 0
  1. @EventHandler
  2. public void onClickInventoryy(InventoryClickEvent e) {
  3. Player player = (Player) e.getWhoClicked();
  4. FileConfiguration config = plugin.getConfig();
  5. String name = config.getString("Inventory-Selector.Title");
  6. String nname = ChatColor.stripColor(name);
  7. if(ChatColor.stripColor(e.getInventory().getName()).equals(nname)){
  8. if(e.getCurrentItem() == null || e.getSlotType() == null || e.getCurrentItem().getType() == Material.AIR) {
  9. e.setCancelled(true);
  10. return;
  11. }else {
  12. if(e.getCurrentItem().hasItemMeta()) {
  13. e.setCancelled(true);
  14. }else{
  15. e.setCancelled(true);
  16. return;
  17. }
  18. }
  19. }
  20. }
Advertisement
Add Comment
Please, Sign In to add comment