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.

xaedblade

Members
  • Joined

  • Last visited

Everything posted by xaedblade

  1. Ok so I've been racking my brain on this one for some time. I have a block that takes damage and is destroyed by mobs. This all works fine. But my problem is that when a mob breaks the block the particles happen on the player and not the block. Any help would be much appreciated. I know that I could use the setBlockAir but I'd rather get the particles... it's so odd because the pos works for the block to update it's state but not to add particles... Code below public void onEntityCollidedWithBlock(World worldIn, BlockPos pos, IBlockState state, Entity entityIn) { if (!worldIn.isRemote) { entityIn.setInWeb(); if(!(entityIn instanceof EntityItem)) { entityIn.attackEntityFrom(DamageSource.CACTUS, 1.0F); int currentDamage = worldIn.getBlockState(pos).getValue(DAMAGE_VALUE); Random randNum = new Random(); if((currentDamage+1) < 5 && randNum.nextInt(100) == 34) { System.out.println(currentDamage); worldIn.setBlockState(pos, this.getDefaultState().withProperty(DAMAGE_VALUE, currentDamage+1)); worldIn.playSound(null, pos, SoundEvents.ENTITY_ZOMBIE_BREAK_DOOR_WOOD, SoundCategory.BLOCKS, 1.0F, 2.0F);; } else if((currentDamage+1) >= 5) { worldIn.playSound(null, pos, SoundEvents.ENTITY_ZOMBIE_BREAK_DOOR_WOOD, SoundCategory.BLOCKS, 1.0F, 2.0F); worldIn.destroyBlock(pos, false); } } } }

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.