nrubin29

BlockSound.java

Jul 25th, 2013
3,134
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.60 KB | None | 0 0
  1. package me.pogostick29.blocksound;
  2.  
  3. import org.bukkit.Bukkit;
  4. import org.bukkit.Sound;
  5. import org.bukkit.event.EventHandler;
  6. import org.bukkit.event.Listener;
  7. import org.bukkit.event.block.BlockBreakEvent;
  8. import org.bukkit.plugin.java.JavaPlugin;
  9.  
  10. public class BlockSound extends JavaPlugin implements Listener {
  11.  
  12.     public void onEnable() {
  13.         Bukkit.getServer().getPluginManager().registerEvents(this, this);
  14.     }
  15.    
  16.     @EventHandler
  17.     public void onBlockBreak(BlockBreakEvent e) {
  18.         if (!e.isCancelled()) e.getBlock().getWorld().playSound(e.getBlock().getLocation(), Sound.GHAST_SCREAM, 1, 1);
  19.     }
  20. }
Advertisement
Add Comment
Please, Sign In to add comment