NoPlugins v2.0

Details

  • Filename
    NoPlugins.jar
  • Uploaded by
  • Uploaded
    Dec 18, 2016
  • Size
    2.37 KB
  • Downloads
    1,879
  • MD5
    a3e101609468cc3694f7eeba7e79281b

Supported Bukkit Versions

  • 1.15
  • 1.14
  • 1.12
  • 1.9
  • 1.8

Changelog

- Now works

 

 

Source:

package me.isaiah.noplugins;

import org.bukkit.ChatColor;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.plugin.PluginManager;
import org.bukkit.plugin.java.JavaPlugin;
import org.bukkit.event.player.PlayerCommandPreprocessEvent;

public class NoPlugins extends JavaPlugin implements Listener {
    public void onEnable() {
        PluginManager pm = getServer().getPluginManager();
        pm.registerEvents(this, this);
    }
    
    public void onDisable() {/**/}
    
    @EventHandler
    public void thePluginCommand(PlayerCommandPreprocessEvent event) {
        String prefix = ChatColor.DARK_GREEN+"["+ChatColor.GREEN+"NoPlugins"+ChatColor.DARK_GREEN+"] "+ChatColor.RESET;
        Player plr = event.getPlayer();
        if (event.getMessage().toLowerCase().startsWith("/plugins") || event.getMessage().toLowerCase().startsWith("/pl")) {
            if (!plr.hasPermission("noplugins.bypass") && !plr.isOp()) {
                event.setCancelled(true);
                plr.sendMessage(prefix+" You don't have permission to see the plugins!");
            } else {
                plr.sendMessage(prefix+" You have permission to see the plugins");
            }
        }
    }
}