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.

ReshiramRocks12

Members
  • Joined

  • Last visited

Everything posted by ReshiramRocks12

  1. I fixed the problem by moving the code into a PlayerTickEvent. Thank you for your help.
  2. This is my code. @EventBusSubscriber public class TNTDefusalHandler { @SubscribeEvent public static void onLivingUpdate(LivingUpdateEvent event) { Entity entity = event.getEntityLiving(); World world = event.getEntityLiving().getEntityWorld(); BlockPos pos = new BlockPos(entity.getPosition().getX(), entity.getPosition().getY() - 1, entity.getPosition().getZ()); if (world.getBlockState(pos).getBlock() == Blocks.TNT) { world.setBlockToAir(pos); } } }
  3. I am using a singleplayer world as my testing world. Do I need to have an actual multiplayer server to make it work?
  4. The event is firing on client side but I am unsure how to make the event fire on server side. How could I do this? Thank you for your help so far
  5. I'm removing the block in a Living Update Subscribe Event and getting the world instance using event.getEntityLiving().getEntityWorld();
  6. How do I remove the block server side?
  7. Hi. I'm having a little trouble with the setBlockToAir method in the World class. I am trying to set a TNT block to air but it doesn't remove it properly and if I walk into the position where the block existed, it glitches my player. It doesn't output any errors in console and it says that the block has been removed whenever I print out the block at that location though it reappears whenever I relog. How can I fix this?

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.