Jump to content

ReshiramRocks12

Members
  • Posts

    7
  • Joined

  • Last visited

ReshiramRocks12's Achievements

Tree Puncher

Tree Puncher (2/8)

0

Reputation

  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?
×
×
  • Create New...

Important Information

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