Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Mooshmooshmodder

Members
  • Joined

  • Last visited

  1. My problem is resolved by using w.playSoundEffect instead of w.playSound. Simple as that. Also, to be clear, it works equally well whether or not it is bracketed by !w.isRemote check.
  2. I have created custom sound in 1.7.10 mod using sounds.json file and w.playsound function. It works great for the player who activates the sound but the sound is not heard by other players on the server. I was not able to figure out from searching how to get w.playsound to play for all players. Can you take a look at this class and let me know what needs to be added for the sound to play for all players (within hearing distance, obviously). Thanks very much. package blinkylightsmod; import java.util.Random; import net.minecraft.util.AxisAlignedBB; import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.Blocks; import net.minecraft.init.Items; import net.minecraft.world.World; import net.minecraft.world.IBlockAccess; import net.minecraft.util.IIcon; public class BlockStar extends Block { private boolean playing; private boolean playing1; public BlockStar() { super(BlinkyLightsMod.star); setStepSound(Block.soundTypeGlass); setCreativeTab(CreativeTabs.tabDecorations); setBlockTextureName("blinkylightsmod:blockStar"); setBlockName("blockStar"); setLightLevel(1.0F); this.playing = false; this.playing1 = false; } public boolean renderAsNormalBlock() { return false; } public boolean isOpaqueCube() { return false; } public int getRenderType() { return 1; } public AxisAlignedBB getCollisionBoundingBoxFromPool(World w, int x, int y, int z) { return null; } public boolean onBlockActivated(World w, int x, int y, int z, EntityPlayer p, int i, float hx, float hy, float hz) { if (p.getCurrentEquippedItem() != null && p.getCurrentEquippedItem().getItem() == BlinkyLightsMod.itemCandyCane) { w.playSound(x, y, z, "blinkylightsmod:deckthehalls", 1.0F, 1.0F, true); return true; } else { w.playSound(x, y, z, "blinkylightsmod:merrychristmas", 1.0F, 1.0F, true); return true; } } }

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.