ThunderBlock (SoundBlock!) 1.1

Provide sounds to block break events!

  1. iHolden
    Contributors:
    iHolden
    Hello!

    Please keep insulting comments to yourself! I am a begginer, and am not looking for anyone to really use this plugin! Just for learning experiences or a derp.

    Anyways, if you download this plugin just install it like any other plugin, but when you break a block, the thunder sound will happen. Now, I do not know anything about config files or stuff like that so I'll just add the code and show you how to change the sound! Quite simple.


    Code (Text):

    package Your.Package.Name;

    import org.bukkit.Bukkit;
    import org.bukkit.event.EventHandler;
    import org.bukkit.event.Listener;
    import org.bukkit.event.block.BlockBreakEvent;
    import org.bukkit.plugin.java.JavaPlugin;

    public class Sound extends JavaPlugin implements Listener {

        public void onEnable() {
            Bukkit.getServer().getPluginManager().registerEvents(this, this);
           
        }
       
        @EventHandler
        public void onBlockBreak(BlockBreakEvent e) {
            if (!e.isCancelled()) e.getBlock() .getWorld() .playSound(e.getBlock().getLocation(), org.bukkit.Sound.AMBIENCE_THUNDER, 1, 1);
           
        }
    }
     
    So that is the code, pretty long right. Only things you need to change really is the package name and class name & where it says "org.bukkit.Sound.AMBIENCE_THUNDER" change it to whatever sound you prefer.

    Thank you.

    Also, does anyone know how to attatch particle effects to blockbreak events with this code?