I have this code:
try {
if (Minecraft.getMinecraft().world.isRemote) {
EntityPlayerSP player = Minecraft.getMinecraft().player;
Minecraft.getMinecraft().world.playSound(player, player.getPosition(), SoundHandler.EVACUATION, SoundCategory.PLAYERS, 1, 1.0F);
}
} catch (Exception ex) {
//Error
}
I want to play it when block activated by redstone, lever
I'm new in Java and Forge