Skip to content

Instantly share code, notes, and snippets.

@Mareckoo01
Last active Sep 2, 2017
Embed
What would you like to do?
Tab complete permission plugin
import java.util.logging.Logger;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.server.TabCompleteEvent;
import org.bukkit.plugin.PluginManager;
import org.bukkit.plugin.java.JavaPlugin;
import org.bukkit.scheduler.BukkitScheduler;
public class TCP extends JavaPlugin implements Listener{
Logger logger = getLogger();
PluginManager pm = getServer().getPluginManager();
BukkitScheduler scheduler = getServer().getScheduler();
@Override
public void onEnable(){
pm.registerEvents(this, this);
}
@Override
public void onDisable(){
}
@EventHandler
public void onTCE(TabCompleteEvent tce){
if(!tce.getSender().hasPermission("tcp.tabcomplete")){
tce.setCancelled(true);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment