Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package com.chrisddie.league;
- import java.util.logging.Logger;
- import org.bukkit.plugin.java.JavaPlugin;
- import org.bukkit.Material;
- import org.bukkit.entity.Player;
- import org.bukkit.event.EventHandler;
- import org.bukkit.event.Listener;
- import org.bukkit.event.block.Action;
- import org.bukkit.event.player.PlayerInteractEvent;
- import org.bukkit.plugin.PluginDescriptionFile;
- public class league extends JavaPlugin implements Listener {
- private final ListenerClass listener = new ListenerClass(this);
- public final Logger logger = Logger.getLogger("Minecraft");
- public static league plugin;
- @Override
- public void onEnable() {
- PluginDescriptionFile pdfFile = this.getDescription();
- this.logger.info(pdfFile.getName() + " Version " + pdfFile.getVersion() + " Has been enabled.");
- this.getServer().getPluginManager().registerEvents(this.listener, this);
- }
- @EventHandler
- public void onInteract(PlayerInteractEvent e) {
- Player p = e.getPlayer();
- if(e.getAction().equals(Action.RIGHT_CLICK_AIR) || e.getAction().equals(Action.RIGHT_CLICK_BLOCK) || e.getAction().equals(Action.LEFT_CLICK_AIR) || e.getAction().equals(Action.LEFT_CLICK_BLOCK)) {
- if(p.getItemInHand().getType().equals(Material.ANVIL)) {
- e.setCancelled(true);
- p.sendMessage("Coding is so frustrating. :(");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment