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);
}
}
}