@@ -0,0 +1,1325 @@
+package net.darkmorford.btweagles.eventhandler;%0A%0Aimport net.darkmorford.btweagles.block.ModBlocks;%0Aimport net.darkmorford.btweagles.sound.ModSounds;%0Aimport net.minecraft.block.Block;%0Aimport net.minecraft.util.EnumParticleTypes;%0Aimport net.minecraft.util.SoundCategory;%0Aimport net.minecraft.util.math.BlockPos;%0Aimport net.minecraftforge.event.world.NoteBlockEvent;%0Aimport net.minecraftforge.fml.common.Mod;%0Aimport net.minecraftforge.fml.common.eventhandler.SubscribeEvent;%0A%0A@Mod.EventBusSubscriber%0Apublic class EventHandlerNoteBlock%0A%7B%0A%09@SubscribeEvent%0A%09public static void playNote(NoteBlockEvent.Play event) %7B%0A%09%09// Check the block underneath the Note Block%0A%09%09Block belowBlock = event.getWorld().getBlockState(event.getPos().down()).getBlock();%0A%0A%09%09// If it's butter, cancel the regular event%0A%09%09if (belowBlock == ModBlocks.butter)%0A%09%09%7B%0A%09%09%09int note = event.getVanillaNoteId();%0A%09%09%09float pitch = (float)Math.pow(2.0D, (double)(note - 12) / 12.0D);%0A%0A%09%09%09BlockPos pos = event.getPos();%0A%09%09%09event.getWorld().playSound(null, pos, ModSounds.airhorn, SoundCategory.RECORDS, 3.0F, pitch);%0A%09%09%09event.getWorld().spawnParticle(EnumParticleTypes.NOTE, (double)pos.getX() + 0.5D, (double)pos.getY() + 1.2D, (double)pos.getZ() + 0.5D, (double)note / 24.0D, 0.0D, 0.0D);%0A%0A%09%09%09if (event.isCancelable())%0A%09%09%09%7B%0A%09%09%09%09event.setCanceled(true);%0A%09%09%09%7D%0A%09%09%7D%0A%09%7D%0A%7D%0A

Add event handler to play airhorn when Note Block is activated.