daily pastebin goal
46%
SHARE
TWEET

Untitled

a guest Jan 17th, 2019 64 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. package ga.crazyskyblock.abstractdev.eventpluginlol;
  2.  
  3. import org.bukkit.ChatColor;
  4. import org.bukkit.Material;
  5. import org.bukkit.entity.Player;
  6. import org.bukkit.event.block.BlockPlaceEvent;
  7. import org.bukkit.plugin.java.JavaPlugin;
  8.  
  9. public final class Eventpluginlol extends JavaPlugin implements Listener {
  10.  
  11.     @Override
  12.     public void onEnable() {
  13.         // Plugin startup logic
  14.         getLogger().info("eventPluginLol has been enabled lol");
  15.         getServer().getPluginManager().registerEvents(new this, this);
  16.  
  17.     }
  18.  
  19.     @Override
  20.     public void onDisable() {
  21.         // Plugin shutdown logic
  22.     }
  23.     @EventHandler
  24.     public void onPlace (BlockPlaceEvent event) {
  25.  
  26.         Player player = event.getPlayer();
  27.  
  28.         if (event.getBlock().equals(Material.TNT)) {
  29.             event.setCancelled(true);
  30.             player.sendMessage(ChatColor.RED + " You cannot place TNT");
  31.  
  32.  
  33.         }
  34.     }
  35.  
  36. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top