@EventHandler public void onPlayerDropItem(PlayerDropItemEvent e) { Player p = e.getPlayer(); if (p.getLocation() .getWorld() .getName() .equals(settings.getConfig().getString("spawn.world"))) { if (!p.hasPermission("hub.editinventory")) { e.setCancelled(true); } } }
public class PlayerDropItem implements Listener { SettingsManager settings = SettingsManager.getInstance(); @EventHandler public void onPlayerDropItem(PlayerDropItemEvent e) { Player p = e.getPlayer(); if (p.getLocation() .getWorld() .getName() .equals(settings.getConfig().getString("spawn.world"))) { if (!p.hasPermission("hub.editinventory")) { e.setCancelled(true); } } } }